Repository navigation
test(discover): repeat the flood's replies until discover is done - #27
Merged
Merged
Conversation
TestHostileDiscoverFlood sent 500 junk datagrams and then the replies of 40 devices once. The junk is several times Linux's default UDP receive buffer (about 208 KiB): when the command's reader runs late on a busy runner, the kernel drops everything after the junk, the replies included, and discover found 0 of 10 (ethernetipctl#26, ubuntu-24.04, Go 1.26 job). A probe with that buffer size and a reader 50 ms late read 304 junk datagrams and 0 of 200 replies. The devices now repeat their replies every 20 ms until the command returns; the flood, the --max-devices limit and the duration bound are unchanged. Fixes #26 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Fixes #26 (
TestHostileDiscoverFloodfinds 0 devices).Cause
net.core.rmem_default, about 208 KiB).--wait 2sand found 0. The failed job ran on ubuntu-24.04 (Go 1.26, no race). The race jobs pass because instrumentation slows the sender down.Change
Test only. The devices repeat their replies every 20 ms (more duplicates) until the command returns. The flood, the
--max-devices 10limit, the 5 s duration bound and the duplicate-counting part of the test are unchanged.The command itself can't avoid this: a UDP reply that the kernel drops never reaches it, and a larger
SO_RCVBUFis capped bynet.core.rmem_maxon Linux. No release is needed, because the binary is unchanged.Verification
make checkpasses locally (coverage 96.1%).🤖 Generated with Claude Code