Fix intermittent test: TestNotifier/MultipleSubscribersStress#865
Merged
Conversation
Try to fix one of the most commonly failing intermittent tests we have
left, which is the stress test in the notifier [1].
--- FAIL: TestNotifier (0.00s)
--- FAIL: TestNotifier/MultipleSubscribersStress (0.98s)
notifier_test.go:409: Generated schema "notifier_2025_04_26t20_08_50_schema_04" with migrations [1 2 3 4 5 6] on line "main" in 376.579906ms [4 generated] [0 reused]
notifier_test.go:434: Sending notification on "test_topic1": msg0
notifier_test.go:434: Sending notification on "test_topic1": msg1
notifier_test.go:434: Sending notification on "test_topic1": msg2
notifier_test.go:434: Sending notification on "test_topic1": msg3
notifier_test.go:434: Sending notification on "test_topic1": msg4
notifier_test.go:434: Sending notification on "test_topic1": msg5
notifier_test.go:434: Sending notification on "test_topic1": msg6
notifier_test.go:472: Channel 0 contains 5 message(s)
notifier_test.go:472: Channel 1 contains 7 message(s)
notifier_test.go:472: Channel 2 contains 0 message(s)
notifier_test.go:477:
Error Trace: /home/runner/work/river/river/internal/notifier/notifier_test.go:477
Error: Should NOT be empty, but was 0xc000244770
Test: TestNotifier/MultipleSubscribersStress
riverdbtest.go:277: Checked in schema "notifier_2025_04_26t20_08_50_schema_04"; 1 idle schema(s) [4 generated] [2 reused]
FAIL
FAIL github.com/riverqueue/river/internal/notifier 2.025s
Rebuild the test a little so that each listen goroutine waits for at
least one message to come through instead of only an arbitrary sleep.
The sleep ~always passes locally, but it seems to be that in CI it's
possible for the sending goroutine to be entirely parked around when a
listen/unlisten loop is happening.
[1] https://github.com/riverqueue/river/actions/runs/14684674639/job/41211780010
bgentry
approved these changes
Apr 27, 2025
Contributor
Author
|
Thanks! |
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.
Try to fix one of the most commonly failing intermittent tests we have
left, which is the stress test in the notifier [1].
Rebuild the test a little so that each listen goroutine waits for at
least one message to come through instead of only an arbitrary sleep.
The sleep ~always passes locally, but it seems to be that in CI it's
possible for the sending goroutine to be entirely parked around when a
listen/unlisten loop is happening.
[1] https://github.com/riverqueue/river/actions/runs/14684674639/job/41211780010