Skip to content

Fix intermittent test TestProducer_PollOnly/JobStuckHandlerOpensExecutorSlot#1313

Open
brandur wants to merge 1 commit into
masterfrom
brandur-fix-intermittent-test
Open

Fix intermittent test TestProducer_PollOnly/JobStuckHandlerOpensExecutorSlot#1313
brandur wants to merge 1 commit into
masterfrom
brandur-fix-intermittent-test

Conversation

@brandur

@brandur brandur commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Fix an intermittent test noticed in CI on another PR [1]. Just changes
the test to only add a worker slot on the first stuck job which makes
the test a little more reliable in slower test environments.

Previously the test opened a replacement slot for every stuck job. After
job 1 became stuck, job 2 started in the replacement slot. Because job 2
also blocked and used the same short timeout, depending on timing, it
could also be marked stuck before the assertion ran, causing another
replacement slot to be opened, and reducing counted active jobs to zero,
with the assertion assuming only job 1 had been handled. The fix here is
to make sure that only one replacement slot can be opened.

[1] https://github.com/riverqueue/river/actions/runs/29541028860/job/87763137367?pr=1312

…utorSlot`

Fix an intermittent test noticed in CI on another PR [1]. Just changes
the test to only add a worker slot on the first stuck job which makes
the test a little more reliable in slower test environments.

Previously the test opened a replacement slot for every stuck job. After
job 1 became stuck, job 2 started in the replacement slot. Because job 2
also blocked and used the same short timeout, depending on timing, it
could also be marked stuck before the assertion ran, causing another
replacement slot to be opened, and reducing counted active jobs to zero,
with the assertion assuming only job 1 had been handled. The fix here is
to make sure that only one replacement slot can be opened.

[1] https://github.com/riverqueue/river/actions/runs/29541028860/job/87763137367?pr=1312
@brandur
brandur requested a review from bgentry July 16, 2026 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant