Commit 6af6deb
authored
Fix intermittent test:
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/41211780010TestNotifier/MultipleSubscribersStress (#865)1 parent 9a3f021 commit 6af6deb
1 file changed
Lines changed: 11 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
459 | 459 | | |
460 | 460 | | |
461 | 461 | | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
462 | 469 | | |
463 | 470 | | |
464 | 471 | | |
| |||
469 | 476 | | |
470 | 477 | | |
471 | 478 | | |
472 | | - | |
473 | | - | |
474 | 479 | | |
475 | 480 | | |
476 | | - | |
477 | | - | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
478 | 485 | | |
479 | 486 | | |
480 | 487 | | |
| |||
0 commit comments