Repository navigation
fix(tests): match timeout status code in event stream timeout test - #2255
Merged
Merged
Conversation
The "should timeout when no events occur" spec asserted on error message
substrings ("deadline", "cancel") with case-sensitive matchers. When the
server tears the stream down with RST_STREAM, the error reads
"code = DeadlineExceeded desc = stream terminated by RST_STREAM with error
code: CANCEL", which matches none of them, so the spec failed even though
the deadline fired correctly.
tryReceiveEvent races ctx.Done() against the stream error channel, so the
error is either the bare context error or a wrapped gRPC status. Assert on
the status code instead of the message to cover both outcomes.
Co-authored-by: Cursor <[email protected]>
Signed-off-by: Tibor Kircsi <[email protected]>
tkircsi
force-pushed
the
fix/events-timeout-assertion
branch
from
October 1, 2026 10:20
0ac68b0 to
53b0f6e
Compare
lgecse
approved these changes
Oct 1, 2026
lgecse
enabled auto-merge
October 1, 2026 10:23
lgecse
disabled auto-merge
October 1, 2026 10:23
lgecse
enabled auto-merge
October 1, 2026 10:23
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
Event Streaming E2E Tests → No events scenario → should timeout when no events occurspec fails intermittently in CI. Example: CI run 36840447776, where it was the only failing spec (106 passed, 1 failed, 1 skipped) and took theTest Clientjob down with it. The two other red E2E jobs in that run (Test Local Kind,Test Network) were collateral cancellations from merge-group fail-fast, not independent failures.The spec asserted on error message substrings using case-sensitive matchers:
When the server tears the HTTP/2 stream down with
RST_STREAM, the error reads:That satisfies none of the three matchers —
DeadlineExceededandCANCELdo not contain the lowercase substrings, andEqual(context.DeadlineExceeded)fails because the value is a wrapped*status.Errorrather than the bare sentinel. The deadline fired exactly as intended; only the assertion was wrong.Why it's flaky rather than always failing
tryReceiveEventraces two select branches. Ifctx.Done()wins, the caller gets the barecontext.DeadlineExceededand the spec passes. If the stream'sErrCh()wins, it gets a wrapped gRPC status whose description varies — the common phrasingdesc = context deadline exceededhappens to contain lowercase "deadline", which is why this usually slips through.Fix
Assert on the gRPC status code instead of the message text, covering both outcomes of the race:
This is test-only; no production code paths change.
Testing
go vet ./e2e/client/is clean and pre-commit hooks (golangci-lint) pass. The spec itself needs a running server, so it was not exercised locally against theRST_STREAMfailure mode — CI is the real verification here.Made with Cursor