Commit 11ebb22
authored
Fix intermittently failing test
Here, try to address an intermittently failing test seen in CI [1].
The problem seems to be that although the test case stubs the current
time with `StubNow`, it's possible for the producer's fetch loop to be
running concurrently and call `NowOrNil()` before the stub takes effect,
causing a divergence from the stubbed time by a few milliseconds.
The fix here drops the use of stubbed now, and instead asserts that the
new `ScheduledAt` is `AttemptedAt` plus the expected retry interval,
using a value from a reloaded job row to guarantee we don't have a race.
We drop the use of time stubbing completely as this approach no longer
requires it.
[1] https://github.com/riverqueue/river/actions/runs/25657083352/job/75308035231Test_Client_JobCompletion/JobThatReturnsErrIsRetryable (#1247)1 parent 4a75e68 commit 11ebb22
1 file changed
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7291 | 7291 | | |
7292 | 7292 | | |
7293 | 7293 | | |
7294 | | - | |
7295 | | - | |
7296 | 7294 | | |
7297 | 7295 | | |
7298 | 7296 | | |
| |||
7304 | 7302 | | |
7305 | 7303 | | |
7306 | 7304 | | |
7307 | | - | |
| 7305 | + | |
7308 | 7306 | | |
7309 | 7307 | | |
7310 | 7308 | | |
| |||
0 commit comments