test(multisocket): deflake restart by using a fresh port and coordinated cleanup#7438
Merged
yongtang merged 1 commit intocoredns:masterfrom Aug 11, 2025
Merged
Conversation
…ted cleanup Avoid transient EADDRINUSE and a previous negative WaitGroup panic: - restart onto a different free port - no Stop() around Restart() - channel-coordinated Stop of the new instance Fixes coredns#7311 Signed-off-by: Syed Azeez <syedazeez337@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7438 +/- ##
==========================================
+ Coverage 55.70% 59.74% +4.04%
==========================================
Files 224 274 +50
Lines 10016 18095 +8079
==========================================
+ Hits 5579 10811 +5232
- Misses 3978 6651 +2673
- Partials 459 633 +174 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
yongtang
approved these changes
Aug 11, 2025
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.
What
Deflake multisocket restart tests by:
Why
CI frequently hit flakes in
TestMultisocket_Restart(issue #7311). Root causes were socket linger and overlapping Stop/Restart sequencing on the same port.How
pickPort(t)probes a free port.port1 → port2(commented rationale in test).Testing
go clean -testcache
go test ./test -run '^TestMultisocket(_Restart|_WhoAmI)?$' -count=200 -shuffle=on -p=1 -race -v
go test ./... -race -shuffle=on -count=1 -p=1
Risk
Low (tests only).
DCO
Signed-off-by: syedazeez337@gmail.com
Fixes
Fixes #7311
Release note
None.