Fix intermittent test: Test_Client_Stop/JobsInProgressCompletingPromptly#864
Merged
Conversation
…ptly`
Fix another failing intermittent test [1] that has timing constraints
that are in practice just too tight for slower environments like GitHub
Actions CI where there might be a lot of parallelism going on and
goroutines may be paused for extended periods.
--- FAIL: Test_Client_Stop (0.00s)
--- FAIL: Test_Client_Stop/JobsInProgressCompletingPromptly (7.80s)
client_test.go:1293: Generated schema "river_test_2025_04_26t20_00_18_schema_14" with migrations [1 2 3 4 5 6] on line "main" in 1.427488883s [14 generated] [8 reused]
logger.go:256: time=2025-04-26T20:00:20.940Z level=INFO msg="River client started" client_id=fv-az1676-608_2025_04_26T20_00_20_859010
client_test.go:1306: timed out waiting for job to start
logger.go:256: time=2025-04-26T20:00:22.416Z level=INFO msg="callback job started with id=1"
logger.go:256: time=2025-04-26T20:00:25.941Z level=INFO msg="producer: Producer job counts" num_completed_jobs=0 num_jobs_running=1 queue=default
client_test.go:166:
Error Trace: /home/runner/work/river/river/client_test.go:166
/opt/hostedtoolcache/go/1.24.2/x64/src/testing/testing.go:1211
/opt/hostedtoolcache/go/1.24.2/x64/src/testing/testing.go:1445
/opt/hostedtoolcache/go/1.24.2/x64/src/testing/testing.go:1786
/opt/hostedtoolcache/go/1.24.2/x64/src/runtime/panic.go:636
/opt/hostedtoolcache/go/1.24.2/x64/src/testing/testing.go:1041
/opt/hostedtoolcache/go/1.24.2/x64/src/testing/testing.go:1118
/home/runner/work/river/river/client_test.go:1306
Error: Received unexpected error:
context deadline exceeded
Test: Test_Client_Stop/JobsInProgressCompletingPromptly
riverdbtest.go:277: Checked in schema "river_test_2025_04_26t20_00_18_schema_14"; 1 idle schema(s) [16 generated] [9 reused]
FAIL
FAIL github.com/riverqueue/river 34.083s
Switch to `riversharedtest.WaitOrTimeout` which tolerates up to 10
seconds in GitHub Actions instead of only 1. Get rid of context timeout
that won't accomplish anything except make tests fail intermittently
(and in general we should use the Go test `-timeout` flag instead
because it prints good stack trace information).
[1] https://github.com/riverqueue/river/actions/runs/14684606192/job/41211616466
bgentry
approved these changes
Apr 27, 2025
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.
Fix another failing intermittent test [1] that has timing constraints
that are in practice just too tight for slower environments like GitHub
Actions CI where there might be a lot of parallelism going on and
goroutines may be paused for extended periods.
Switch to
riversharedtest.WaitOrTimeoutwhich tolerates up to 10seconds in GitHub Actions instead of only 1. Get rid of context timeout
that won't accomplish anything except make tests fail intermittently
(and in general we should use the Go test
-timeoutflag insteadbecause it prints good stack trace information).
[1] https://github.com/riverqueue/river/actions/runs/14684606192/job/41211616466