Repository navigation
test(coop): cover a SHARED production unit reaching the client mid-batch and at month end - #232
Merged
Conversation
…tch and at month end Drives the issue #134 job (the client starts 40x STR_LASER_PISTOL at 1 engineer) and checks that a unit finished on an ordinary hour, and one finished in the month-roll step, reach the client's stores while the host is held off the geoscape, so no checksum resync can repair a miss. Fails 3/3 with the per-unit prod_fx message switched off; passes 20/20 on main.
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.
Refers to #134. Test-only: no product change.
Symptom
On 2026-08-02
test_shared_month_runfailed 2 of 3 runs after month end #1 with.bases[0].items.STR_LASER_PISTOL: 1 != <absent on client>. The first finished unit of a running 40x STR_LASER_PISTOL job reached the host's stores but never the client's.Cause
On that build (#166), a SHARED production sent the client nothing until the whole batch finished:
GeoscapeStatecalledhostProductionDoneonly when the production completed. A unit finished mid-batch existed only on the host until a world resync repaired it. #212 added a per-unitprod_fxmessage that carries the base's stores to the client in the hour the host makes each unit.Evidence on current main:
test_shared_month_runpassed 10/10 (2 at a time). Its engine logs hold noprod_fxline. At about 170 game hours against the pistol's 300, no unit finishes inside that test any more, so it no longer exercises this path.prodFxforced false inGeoscapeState, the behaviour before feat(coop): rewrite the co-op battlescape on a host-authoritative battle #212), it fails 3/3 with the issue's signature. The month-roll row also fails the same way when run on its own:Fix
No product change is needed: #212 fixed it. This PR adds
test_shared_production_unit_sync.py. It drives the issue's exact job (the client starts 40x STR_LASER_PISTOL at 1 engineer through the real ManufactureInfoState) and checks two hourly steps:mid_batch: unit 1 finishes on an ordinary hour.month_end: unit 2 finishes in the step that rolls the month. This is the timing the original failure hit.Each row:
The test ends with full world equality and the zero-disk check.
test_production_effects.pycovers the same message with a test mod. This test adds the vanilla rule, the client-started 40x job and the month-roll step.Tests
395cc44fd: 20/20 pass, 2 at a time. The first 20-run attempt failed once in its first 9 runs: a UFO-detected popup opened on both machines during the month-end roll and stopped the clock for the whole roll. The engine logs show it pushed at 14:17:09.9 and still open at teardown. The roll now closes such popups, and the count was restarted. One of the final 20 runs hit that popup and passed.test_shared_month_run: 10/10 pass ond906ebd67and 2/2 on395cc44fd.tools/ci/test_weights.jsonat 36 s (measured 33-34 s). That is under the 180 s default budget, soslow_test_exceptions.jsonneeds no entry. A row was added to the SHARED table intools/coop_test/README.md.