Repository navigation
Make the concurrent routine-sweep test read the same firing - #921
Open
rudycelekli wants to merge 1 commit into
Open
rudycelekli wants to merge 1 commit into
rudycelekli wants to merge 1 commit into
Conversation
Make both replicas read the original due timestamp before either offers a firing. Promise.all alone could let the slower read see the next ancient-but-still-due timestamp, testing a different interleaving and intermittently queueing two distinct dates. Production scheduling and queue code are unchanged. AI assistance: implemented and locally validated with OpenAI Codex; maintainer review remains required.
rudycelekli
requested review from
MikeRyanDev,
davidmckayv,
dustywusty,
guidovizoso,
mxmzb,
samjulien and
tylerslaton
as code owners
October 31, 2026 03:48
9 tasks done
This branch has not been deployed
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.
What this changes
Make the concurrent routine-sweep regression exercise the race its assertions describe. The existing Promise.all could let the second sweep read the already advanced firing. Because the fixture dates its rows to 2001 while due eligibility uses Postgres's current clock, that later firing is legitimately still due and the test can report two queue entries.
Both sweeps now finish their real database read of the same firing before either can offer it. The real queue uniqueness and clock compare-and-set remain under test; the spy is restored in finally. No production behavior changes.
Where it runs
Boundary and audit
Changelog
Proof
Base
743649efc3f21d7bf0badbe6af2bcd5daedd97ce, head31072c2fa92619918a82080fe6b582d95e0bd672.Tests use a dedicated disposable local Postgres15 database; hosted CI uses Postgres17. No live vendor credentials or application database were used.
AI assistance: implemented and locally validated with OpenAI Codex. Hosted CI and maintainer review remain required.