Repository navigation
Description
Is there an existing issue for the same bug?
I have checked the existing issues.
Branch Name
main
Commit ID
Other Environment Information
- Hardware parameters: GitHub-hosted Ubuntu/x86 runner
- OS type: Linux
- Others: MatrixOne CI / UT Test on Ubuntu/x86
Actual Behavior
TestRPCSendWithNotSupport intermittently fails in the lockservice unit-test package:
[TEST]: TestRPCSendWithNotSupport
[RESULT]: fail
[ELAPSED]: 0.19
rpc_test.go:321: Error: Should be true
--- FAIL: TestRPCSendWithNotSupport (0.19s)
The test expects the server's moerr.ErrNotSupported, but the request context has a fixed 100 ms deadline. Under CI scheduling or RPC startup delay, the deadline can win before the server response is decoded, so the assertion receives a transport/context error instead of the error that the test intends to validate.
The failure was observed in:
https://github.com/matrixorigin/matrixone/actions/runs/29087118926/job/86343372131?pr=25577
PR #25577 only changes planner/index files, so this is an unrelated lockservice test flake on main.
Expected Behavior
Tests that validate a concrete RPC response should use a generous upper bound that prevents hangs without treating normal CI scheduling delay as product behavior. Tests that intentionally validate timeout behavior should retain a short deadline.
Steps to Reproduce
- Run
go test ./pkg/lockservice -run '^TestRPCSendWithNotSupport$' -count=100. - Run under CPU contention or a loaded CI runner.
- Observe that the 100 ms request deadline can expire before the server's unsupported-method response arrives.
The race is environment-dependent; 100 local repetitions may pass on an idle machine.
Additional information
The same file previously extended comparable response-based lockservice tests from 100 ms to 10 seconds in #19412, but this test and several other response-based RPC tests were missed.
The systematic fix should:
- use a shared generous timeout for RPC tests that expect a server response;
- preserve the short timeout in
TestRequestCanBeFilter, where expiration is the behavior under test; - improve the assertion so future failures include the actual returned error;
- run repeated and race-enabled lockservice tests.
Activity
test(lockservice): deflake RPC response tests (#25579)
test(lockservice): deflake RPC response tests (matrixorigin#25579)
test(lockservice): deflake RPC response tests (matrixorigin#25579)
test(lockservice): deflake RPC response tests (matrixorigin#25579)