De-flake test_resample_merge_system: assert samples, not message count#165
Merged
Conversation
test_resample_merge_healthy_system intermittently failed on Windows CI
("got 29" against `n_msgs >= 50`). The captured log shows subscriber
backpressure and a normal termination: the same data was delivered
coalesced into far fewer messages (108 locally vs 29 on a loaded runner),
so message count is a scheduling artifact.
Total samples is not a reliable substitute for the glitch/reset cases:
the reference-reset re-anchoring drops a timing-dependent amount of data,
so the recovered run measured 1710 samples locally but 960 on CI.
Assert instead on `last_t`, the stream-time of the final emitted sample --
how far through the signal the output reached. It is insensitive to both
coalescing and mid-stream drops, and only falls if the tail is truncated.
Measured dead-stable: healthy 1.799 s, seized 0.449 s, recovered/composite
0.799 s. Thresholds (healthy > 1.5, seized < 0.6, recovered > 0.6) sit
with wide margin between the regimes.
Also raise the idle-gap TerminateOnTimeout from 2.0 s to 4.0 s so a
transient CI stall cannot open an output gap that truncates the tail
(which is the one thing `last_t` is sensitive to).
aa41fba to
23ca1a9
Compare
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_resample_merge_healthy_systemintermittently fails on Windows CI (e.g. run 28556535265) with:The graph terminates normally under subscriber backpressure — nothing crashes. The tests asserted on quantities that a scheduling/reset race makes non-deterministic.
Why counts are unreliable
The robust invariant: stream progress
Assert on
last_t— the stream-time of the final emitted sample, i.e. how far through the signal the output reached. It's insensitive to coalescing and to mid-stream sample drops; it only falls if the tail is truncated. Measured dead-stable across runs:Thresholds sit with wide margin between the regimes: healthy
> 1.5, seize< 0.6, recover/composite> 0.6(the seized run stops at the glitch ~0.45 s; recovered runs continue to the re-anchored end ~0.8 s). Channel-count checks kept;n_msgs > 0retained only as a liveness sanity in the seize case.Also
Raise the idle-gap
TerminateOnTimeoutfrom 2.0 s → 4.0 s so a transient CI stall can't open an output gap that truncates the tail — the one thinglast_tis sensitive to.Same philosophy as
2ba329d(de-flake test_decimate_system): stop asserting on a quantity a termination/scheduling race makes non-deterministic.Verification
pytest tests/integration/ezmsg/test_resample_merge_system.py— 4 passed, stable across repeated local runs.