Repository navigation
test(server): make the level-test double-answer test deterministic (B-31) - #135
Merged
Merged
Conversation
…-31) "only one answer per question counts" sent two answers at once, but when the first one finished before the second read the test, the second was correctly taken as the answer to question 2, so the test failed now and then (it blocked a dev deploy). The two calls now wait at the model until both have read the test, so they always race for the same question. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🎉 This PR is included in version 1.3.0-dev.27 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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
The Deploy dev run after #134 failed on
level_test/__tests__/level-test.test.ts› "only one answer per question counts" (run 38822899322). The server code is fine; the test was timing-dependent.The test sends two answers at once and expects only one to count. When the first call finished before the second one read the test, the second answer was correctly taken as the answer to question 2 (the failing run returned index 2 and index 3). The claim on
answeredonly stops two answers that read the same state, which the test did not force.The test now holds both calls at the (mocked) model until both have arrived there, so both have read the test before either saves, and they always race for the same question. A 2-second fallback keeps it from hanging.
Row: B-31 (test only, no production code).
How it was tested
src/modules/language/level_test: 16 tests pass, 5 runs in a row.🤖 Generated with Claude Code