Repository navigation
Conversation
TestSwitchClosesRejectedDuplicateIPConn assumed the first connection reaches the switch first. The transport handshakes each inbound connection in its own goroutine and hands it over in completion order, so the second can take the IP's only slot instead. The first is then the one rejected, nobody watches its error channel, and the test times out after 10s with "the rejected connection was left open by the switch". Wait for the first to occupy the slot, as TestSwitchClosesRejectedOverCapacityConn already does.
Collaborator
🛠 PR Checks SummaryAll Automated Checks passed. ✅ Manual Checks (for Reviewers):
Read More🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers. ✅ Automated Checks (for Contributors):🟢 Maintainers must be able to edit this pull request (more info) ☑️ Contributor Actions:
☑️ Reviewer Actions:
📚 Resources:Debug
|
This branch has not been deployed
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.
TestSwitchClosesRejectedDuplicateIPConnflakes inci / tm2, failing withswitch_duplicate_ip_test.go:163: the rejected connection was left open by the switchafter a 10s timeout. Recent hits on unrelated branches: 40308030247, 38332122105, 37707941642.The test assumes the first connection reaches the switch first.
MultiplexTransporthandshakes each inbound connection in its own goroutine and hands it to the switch in completion order, so the second connection can take the IP's only slot. The first one is then rejected, but the test only watches the second one's error channel, so it waits until the timeout. The switch behaves correctly; the test is wrong about the order.The fix waits for the first peer to occupy the slot before dialing the second, the same wait
TestSwitchClosesRejectedOverCapacityConnalready has ("or the second may beat it there").Testing: I ran the real test function as 2000 parallel subtests (
-cpu 4), pinned to one core shared with 3 busy loops:go test ./tm2/pkg/p2p/passes, and so do the duplicate-IP tests run with-race -count=20.Test-only change; written with AI assistance and reviewed by me.