Pin the event roll in the foundering-voyage test (flake) - #201
Merged
Merged
Conversation
The test patched randint and random but not rollEvent's random.choice, so a run that drew only harmless events never foundered - red about one run in forty, including on main at b68b09a. Every leg now presents the leak, whose first choice always damages. Thirty consecutive runs green. Closes #200 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KaGDnS44p4wsoDADXhyh9M
4 of 5 tasks
dmccoystephenson
added a commit
that referenced
this pull request
Sep 22, 2026
#201 patched rollEvent on src.business.adventures, but docks imports adventures as business.adventures - pytest.ini puts both . and src on the path, so those are two module objects and the patch never reached the call site. The flake it meant to fix survived it: main went red again on the very next run (35556530705). The roll is now pinned with patch.object on docks.adventures, and the day assertion is exact (she founders on leg one), so a roll that isn't pinned fails five runs in seven instead of one in forty. Forcing the real roll to driftwood every leg fails on main's version of the test and passes here; 200 consecutive plain runs, 0 failures. Co-authored-by: Claude Opus 5 (1M context) <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.
Summary
test_a_voyage_that_founders_ends_earlypatchedrandom.randintandrandom.randominadventuresbut notrollEvent, which draws the leg's event withrandom.choice. A run that drew only harmless events (driftwood, calm, good grounds) never took damage and never foundered — red about one run in forty, including onmainatb68b09a(run 35554330178), which is currently blocking the gateway's watched-submodule bump of FishE. The test now pins every leg to the leak event, whose first choice always damages.Closes #200
Test plan
./test.sh→ 910 passeddrafted by Claude on behalf of Daniel Stephenson
🤖 Generated with Claude Code
https://claude.ai/code/session_01KaGDnS44p4wsoDADXhyh9M