savestates Device tests abort under a bare cargo test --lib: adopt with_big_stack
#25
Labels
No Label
blocked
bounced
in-progress
in-review
manual-only
needs-guidance
netplay
p1
p2
p3
rust
No Milestone
No project
No Assignees
1 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: pbwraith/gopher64-netplay#25
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
!24(#23) landed two mitigations for the 2 MiB libtest stack abort:scripts/gate.shexportsRUST_MIN_STACK=8388608-- immunises THE GATE.src/test_util.rs::with_big_stack-- runs a test body on anexplicitly sized 8 MiB thread, so a test is independent of the ambient stack
on any runner, with no env var.
!15(#2) merged the first realDevice-constructing tests ontomainandthey rely on (a) only. So
mainnow passes its own gate and aborts under themost natural command a contributor types.
Measured on the !15 merge result (da21ff1), not inferred
Under the documented gate command:
Under a bare
cargo test --libwith the stack budget at the libtest default(same shell, same provisioning env from
gate.sh, onlyRUST_MIN_STACKchanged to 2097152):
Note what that costs: the abort kills the whole binary, so the four tests that
had not yet reported are simply gone. One unwrapped test hides every other
result -- which is precisely how #23 stayed invisible while step 3 was
vacuous.
Scope
Wrap the
Device-constructing test bodies insavestateswith the existinghelper. This is mechanical:
Apply to every test in
src/savestates.rsthat constructs or deserialises aDevice-- at minimumnetplay_in_memory_savestate_round_trip_restores_device, and checknetplay_process_savestates_uses_in_memory_snapshotandoffline_explicit_save_stays_on_disk_path_and_never_populates_memorythe sameway rather than assuming they are safe because they pass today (they pass
under the gate's 8 MiB, which proves nothing about 2 MiB).
Acceptance
RUST_MIN_STACK=2097152 cargo test --libruns to completion and reports8 passed; 0 failedwith NOstack overflow/ SIGABRT line. Quote theactual output in the PR.
bash scripts/gate.shstill endsGATE_OKwith the same 8 tests.RUST_MIN_STACKfromscripts/gate.sh-- belt and braces wasa deliberate choice in !24, and it is what protects tests nobody has
remembered to wrap.
Out of scope
src/savestates.rsorsrc/device.rs.with_big_stack's 8 MiB budget or theMAX_DEVICE_SIZEtripwire.!11/!18, which I have already bounced with this same adoption note aspart of their rebases -- do not edit those branches from here.
Verification note for whoever takes this
Do not judge the bare run by the shell exit code.
cargo test ... | tailgivesyou
tail's status, not cargo's -- the SIGABRT is visible in the OUTPUT, notin
$?. Read the text.