Skip to content

Harden two more load-sensitive tests - #136

Merged
plotarmordev merged 3 commits into
mainfrom
fix/load-sensitive-tests-2
Oct 20, 2026
Merged

plotarmordev merged 3 commits into
mainfrom
fix/load-sensitive-tests-2

Conversation

@plotarmordev

@plotarmordev plotarmordev commented Oct 20, 2026 •

Copy link
Copy Markdown
Owner

Summary

Two more tests that failed only under heavy machine load. Both were test problems, not product bugs. Test-only change, apart from making one function visible to its test module.

  • process::tests::cancellation_interrupts_normal_exit_pipe_drain
    • Cause: it raised a real process-wide SIGINT. A concurrently running test could install its own interrupt handler and receive that signal instead. Reproduced 5/40 with both tests running together.
    • Fix: the test now calls the capture guard's handler directly; cancel is pub(super). Real signal delivery stays covered end to end by external_program_cancellation_cleans_only_owned_group, which signals a separate process.
  • systemone_tests::compare_reports_a_declared_change_under_the_observed_envelope
    • Cause: it assumed a fixed 40 ms delay always outlasts the fast server's bursts. Under load, bursts reached 1.47 s. Reproduced 18/96.
    • Fix: the fast capture runs first, and the slow server's delays follow the observed makespans.
    • New assertions: they compare the report's reference and candidate envelopes against exact extrema computed independently from the retained A+A2 and B waves. That closes a coverage gap where omitting A2 from pooling went unnoticed.
  • Not reproduced: sparkdash_portable_copies… stayed green over 540 loaded runs plus injected delays, so it's left unchanged.

Testing

  • cargo fmt --check and cargo clippy --all-targets -- -D warnings.
  • Loaded loops: 240/240 and 150/150 runs passed per test.
  • Mutants: drain cancellation, the cancel flag, reversed gate direction, swapped pooling, omitting A, and omitting A2 are all caught.
  • Review: built by WRITER, then SIX for round 2. A blind SIX review approved after one round.

Performance claim

None.

The drain-cancellation test raised a process-wide SIGINT. When the
bounded run test installed its interrupt latch during that window, the
signal reached the run latch instead: the process test waited for pipe
EOF and the run test stopped before dispatch. Invoke the guard's handler
directly; CLI tests still deliver real SIGINT/SIGTERM to the collector.

The System One compare test assumed a 40 ms reference delay outlasts
every candidate burst. Loaded hosts stretched candidate bursts past
1.4 s. Capture the candidate first and delay each reference request by
its slowest retained burst, so the declared change holds by construction.
@plotarmordev
plotarmordev marked this pull request as ready for review October 20, 2026 13:49
@plotarmordev
plotarmordev merged commit aad5dbc into main Oct 20, 2026
7 checks passed
@plotarmordev
plotarmordev deleted the fix/load-sensitive-tests-2 branch October 20, 2026 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant