Repository navigation
✅ test(commitments): keep commitment tests off the shared job queue - #104
Merged
Merged
Conversation
Changing a task's status supersedes its status claim, which enqueues an atlas refresh. In the commitment tests that loaded the queues module, which starts a BullMQ worker in the test process. In CI every test file shares one Redis, so that worker could pick up other files' jobs, and their lazy imports could land in the module registry between this file's per-test database mocks. A later test then wrote through the real database URL and failed with relation "users" does not exist. The atlas refresh now honors the existing skip-job-enqueue seam, and the commitment tests turn it on, so they never load the queues module. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
enqueueAtlasUserRefreshOnSupersedenow returns early when the existingsetSkipJobEnqueuetest switch is on.insert-new-sources,extract-graphand the context cache already use the same switch.src/lib/commitments.test.tsturns that switch on, next to thesetSkipEmbeddingPersistence(true)call it already makes.Production behavior is unchanged. The switch is off unless a test turns it on.
Why
setCommitmentStatus › does not keep an explicit status change in the candidate bandfailed on #103 withrelation "users" does not exist. That PR doesn't touch commitments.The likely chain:
maybeEnqueueAtlasInvalidationenqueues an atlas refresh.~/lib/queues, which starts a BullMQWorkerinside the test process.vi.resetModules()andvi.doMock("~/utils/db").useDatabase, which points at the adminpostgresdatabase. That database has nouserstable.I didn't reproduce the CI race directly. The evidence that the queue path was involved:
mainwith Redis stopped, threesetCommitmentStatustests time out at the queue call.The other claim-writing test files never reach Redis. I checked each with the same Redis-stopped probe, so only this file needed the switch.
How to test
Status
tsc --noEmit: pass🤖 Generated with Claude Code