fix: ignore library keepalive pings when asserting mock wire traffic - #9
Merged
Merged
Conversation
The irc crate sends one PING (a bare local timestamp) immediately after the MOTD because its ping interval's first tick fires right away. Under load the worker's write is delayed into the wire() capture window, so strict equality assertions on captured lines intermittently saw the keepalive and failed on CI windows runners. Filter payload-numeric PINGs in the fixture; the wire-barrier sentinel is unaffected.
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
The post-merge CI run on
main(36599413518) failed onwindows-latest: twodynamic_channelsintegration tests asserted exact wire traffic and intermittently saw an extraPING <timestamp>line.Root cause
The
irccrate'sPingerbuilds its timer withtokio::time::interval, whose first tick fires immediately. The pinger is enabled onRPL_ENDOFMOTD, so the client sends onePING <Local::now().timestamp()>right after registration instead of after 180s. When that write lands on the wire depends on worker-thread scheduling: on a loaded CI runner it can be delayed into thewire()fixture's capture window, breaking strict equality assertions. Same tree passed the PR run and failed the main run — pure timing flake, no production impact.Fix
wire()intests/dynamic_channels.rsnow skips PING lines whose payload is pure ASCII digits (the library keepalive). ThePING :wire-barriersentinel carries a non-numeric payload and is unaffected. No production code changes.Verification
dynamic_channelsruns green, including 8 rebuild-then-first-run cycles reproducing the CI cold-start condition.cargo fmt --all --checkandcargo clippy --all-targets -- -D warningsclean.