[GH-ISSUE #6913] Ruleset classic-items regression lane fails now and then: its directed battle can end before the test is done #3878

Closed
opened 2026-10-21 06:08:24 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @kolacheee on GitHub (Sep 30, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6913

Originally assigned to: @kolacheee on GitHub.

scripts/regressions/game-ruleset-classic-items.regression.ts fails intermittently in its combat-director section with {"error":"Battle already finished."} (400 !== 200) from onAdasTurn, when the test tries to use the second item (the litany page).

Cause: the directed battle is Ada (30 HP) against a Rat (30 HP, attack 8). Initiative is rolled again every round, so the rat can act twice between Ada's turns, and the dawn bell can hit hard, so the battle can end on the dice before the test's second command.

Seen once in a full pnpm regression run on the merged #6910 code (479/480); the lane passed alone several times before.

Fix: give both sides 300 HP and the rat no attack, so neither side can end the battle before the test is done.

Originally created by @kolacheee on GitHub (Sep 30, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6913 Originally assigned to: @kolacheee on GitHub. `scripts/regressions/game-ruleset-classic-items.regression.ts` fails intermittently in its combat-director section with `{"error":"Battle already finished."}` (400 !== 200) from `onAdasTurn`, when the test tries to use the second item (the litany page). Cause: the directed battle is Ada (30 HP) against a Rat (30 HP, attack 8). Initiative is rolled again every round, so the rat can act twice between Ada's turns, and the dawn bell can hit hard, so the battle can end on the dice before the test's second command. Seen once in a full `pnpm regression` run on the merged #6910 code (479/480); the lane passed alone several times before. Fix: give both sides 300 HP and the rat no attack, so neither side can end the battle before the test is done.
bsakaguchi 2026-10-21 06:08:24 +07:00
Author
Owner

@kolacheee commented on GitHub (Sep 30, 2026):

A second lane of the same arc failed the same way in #6914's CI: game-ruleset-loot.regression.ts asserted that the bags hold exactly what the moth's table dropped, but the party starts with two hand axes, so whenever the table's weapon line picked a hand axe the count was 3, not 1 ("Hand axe is in the bags", 3 !== 1). #6914 now also counts the drop past what the party carried in. Proven by forcing the table to drop a hand axe: the old assertion fails, the new one passes.

<!-- gh-comment-id:5920148197 --> @kolacheee commented on GitHub (Sep 30, 2026): A second lane of the same arc failed the same way in #6914's CI: `game-ruleset-loot.regression.ts` asserted that the bags hold exactly what the moth's table dropped, but the party starts with two hand axes, so whenever the table's weapon line picked a hand axe the count was 3, not 1 ("Hand axe is in the bags", 3 !== 1). #6914 now also counts the drop past what the party carried in. Proven by forcing the table to drop a hand axe: the old assertion fails, the new one passes.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#3878
No description provided.