Skip to content

test(lockservice): deflake RPC response tests - #25579

Merged
XuPeng-SH merged 3 commits into
mainfrom
fix/flaky-rpc-send-not-supported
Jul 10, 2026
Merged

XuPeng-SH merged 3 commits into
mainfrom
fix/flaky-rpc-send-not-supported

Conversation

@XuPeng-SH

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

fixes #25578

What this PR does / why we need it:

TestRPCSendWithNotSupport validates that an unregistered lockservice RPC method returns moerr.ErrNotSupported. Its request used a 100 ms context deadline, so a loaded CI runner could expire the context before the server response was decoded and fail with a transport/context error instead.

This change:

  • introduces a shared 10-second upper bound for lockservice RPC tests that expect a concrete server response;
  • applies it to all comparable response-based tests that still used the fragile 100 ms deadline, including TestRPCSendWithNotSupport;
  • keeps the 100 ms deadline in TestRequestCanBeFilter, because timeout is the behavior that test intentionally validates;
  • reports the actual error type and value when the unsupported-method contract is violated.

The longer deadline is only a hang guard and does not increase successful test duration. No production code, RPC timeout, retry behavior, or error handling is changed.

Root Cause

The 100 ms deadline tested CI scheduling and local RPC startup latency rather than the unsupported-method contract. Similar lockservice tests were extended to 10 seconds in #19412, but this test and several neighboring response-based tests were missed.

Testing

  • go test ./pkg/lockservice -run '^(TestRPCSend|TestSetRestartServiceRPCSend|TestAbortRemoteDeadlockTxnFailed|TestCanRestartServiceRPCSend|TestRemainTxnServiceRPCSend|TestRPCSendWithNotSupport|TestMOErrorCanHandled|TestRequestCanBeFilter|TestLockTableBindChanged)$' -count=100
  • go test -race ./pkg/lockservice -run '^(TestRPCSendWithNotSupport|TestRPCSend|TestRequestCanBeFilter)$' -count=20
  • go test ./pkg/lockservice -count=1

@XuPeng-SH
XuPeng-SH requested a review from iamlinjunhong as a code owner July 10, 2026 11:29
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@XuPeng-SH
XuPeng-SH merged commit 85c0eef into main Jul 10, 2026
4 of 7 checks passed
@XuPeng-SH
XuPeng-SH deleted the fix/flaky-rpc-send-not-supported branch July 10, 2026 12:35
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## What type of PR is this?

- [ ] API-change
- [x] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [x] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

fixes matrixorigin#25578

## What this PR does / why we need it:

`TestRPCSendWithNotSupport` validates that an unregistered lockservice
RPC method returns `moerr.ErrNotSupported`. Its request used a 100 ms
context deadline, so a loaded CI runner could expire the context before
the server response was decoded and fail with a transport/context error
instead.

This change:

- introduces a shared 10-second upper bound for lockservice RPC tests
that expect a concrete server response;
- applies it to all comparable response-based tests that still used the
fragile 100 ms deadline, including `TestRPCSendWithNotSupport`;
- keeps the 100 ms deadline in `TestRequestCanBeFilter`, because timeout
is the behavior that test intentionally validates;
- reports the actual error type and value when the unsupported-method
contract is violated.

The longer deadline is only a hang guard and does not increase
successful test duration. No production code, RPC timeout, retry
behavior, or error handling is changed.

## Root Cause

The 100 ms deadline tested CI scheduling and local RPC startup latency
rather than the unsupported-method contract. Similar lockservice tests
were extended to 10 seconds in matrixorigin#19412, but this test and several
neighboring response-based tests were missed.

## Testing

- `go test ./pkg/lockservice -run
'^(TestRPCSend|TestSetRestartServiceRPCSend|TestAbortRemoteDeadlockTxnFailed|TestCanRestartServiceRPCSend|TestRemainTxnServiceRPCSend|TestRPCSendWithNotSupport|TestMOErrorCanHandled|TestRequestCanBeFilter|TestLockTableBindChanged)$'
-count=100`
- `go test -race ./pkg/lockservice -run
'^(TestRPCSendWithNotSupport|TestRPCSend|TestRequestCanBeFilter)$'
-count=20`
- `go test ./pkg/lockservice -count=1`

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## What type of PR is this?

- [ ] API-change
- [x] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [x] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

fixes matrixorigin#25578

## What this PR does / why we need it:

`TestRPCSendWithNotSupport` validates that an unregistered lockservice
RPC method returns `moerr.ErrNotSupported`. Its request used a 100 ms
context deadline, so a loaded CI runner could expire the context before
the server response was decoded and fail with a transport/context error
instead.

This change:

- introduces a shared 10-second upper bound for lockservice RPC tests
that expect a concrete server response;
- applies it to all comparable response-based tests that still used the
fragile 100 ms deadline, including `TestRPCSendWithNotSupport`;
- keeps the 100 ms deadline in `TestRequestCanBeFilter`, because timeout
is the behavior that test intentionally validates;
- reports the actual error type and value when the unsupported-method
contract is violated.

The longer deadline is only a hang guard and does not increase
successful test duration. No production code, RPC timeout, retry
behavior, or error handling is changed.

## Root Cause

The 100 ms deadline tested CI scheduling and local RPC startup latency
rather than the unsupported-method contract. Similar lockservice tests
were extended to 10 seconds in matrixorigin#19412, but this test and several
neighboring response-based tests were missed.

## Testing

- `go test ./pkg/lockservice -run
'^(TestRPCSend|TestSetRestartServiceRPCSend|TestAbortRemoteDeadlockTxnFailed|TestCanRestartServiceRPCSend|TestRemainTxnServiceRPCSend|TestRPCSendWithNotSupport|TestMOErrorCanHandled|TestRequestCanBeFilter|TestLockTableBindChanged)$'
-count=100`
- `go test -race ./pkg/lockservice -run
'^(TestRPCSendWithNotSupport|TestRPCSend|TestRequestCanBeFilter)$'
-count=20`
- `go test ./pkg/lockservice -count=1`

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## What type of PR is this?

- [ ] API-change
- [x] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [x] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

fixes matrixorigin#25578

## What this PR does / why we need it:

`TestRPCSendWithNotSupport` validates that an unregistered lockservice
RPC method returns `moerr.ErrNotSupported`. Its request used a 100 ms
context deadline, so a loaded CI runner could expire the context before
the server response was decoded and fail with a transport/context error
instead.

This change:

- introduces a shared 10-second upper bound for lockservice RPC tests
that expect a concrete server response;
- applies it to all comparable response-based tests that still used the
fragile 100 ms deadline, including `TestRPCSendWithNotSupport`;
- keeps the 100 ms deadline in `TestRequestCanBeFilter`, because timeout
is the behavior that test intentionally validates;
- reports the actual error type and value when the unsupported-method
contract is violated.

The longer deadline is only a hang guard and does not increase
successful test duration. No production code, RPC timeout, retry
behavior, or error handling is changed.

## Root Cause

The 100 ms deadline tested CI scheduling and local RPC startup latency
rather than the unsupported-method contract. Similar lockservice tests
were extended to 10 seconds in matrixorigin#19412, but this test and several
neighboring response-based tests were missed.

## Testing

- `go test ./pkg/lockservice -run
'^(TestRPCSend|TestSetRestartServiceRPCSend|TestAbortRemoteDeadlockTxnFailed|TestCanRestartServiceRPCSend|TestRemainTxnServiceRPCSend|TestRPCSendWithNotSupport|TestMOErrorCanHandled|TestRequestCanBeFilter|TestLockTableBindChanged)$'
-count=100`
- `go test -race ./pkg/lockservice -run
'^(TestRPCSendWithNotSupport|TestRPCSend|TestRequestCanBeFilter)$'
-count=20`
- `go test ./pkg/lockservice -count=1`

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working kind/test-ci size/S Denotes a PR that changes [10,99] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: TestRPCSendWithNotSupport is flaky under CI load

2 participants