db/downloader: keep the BT discovery tests off UDP - #23204
Queued
AskAlexSharov wants to merge 2 commits into
Queued
Conversation
torrent.NewClient binds the dynamic port it got for TCP on UDP as well, for uTP. Windows runners reserve UDP port ranges, so that second bind can fail with WSAEACCES and take NewClient down with it once the library exhausts its listen retries. The tests inject peers by TCP address and already run without DHT, so uTP was never used. Route the three client configs through one helper that disables uTP along with DHT and trackers.
sudeepdino008
approved these changes
Aug 12, 2026
AskAlexSharov
added this pull request to the merge queue
Aug 12, 2026
Any commits made after this event will not be merged.
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.
TestBTPeerDiscovery_AddPeersFromENRfails intermittently on the windows-2025 runner:torrent.NewClientbinds the dynamic port the TCP listener was given on UDP as well, for uTP. Windows reserves UDP port ranges, so that second bind can returnWSAEACCES; the library retries with fresh ports up tolistenAllRetryLimitand then failsNewClientoutright.The tests never needed uTP — peers are injected by TCP address and DHT is already off. Setting
DisableUTP(with theNoDHTthese configs already set) drops the UDP listeners:The three client configs in the file now go through one helper so a future test cannot reintroduce the UDP bind.
go test ./db/downloader/ -run TestBTPeerDiscovery -count=3passes.Not fixed here: the same windows job also failed
TestRecordPreload_RecordsElapsedAndBytes(execution/commitment), which is unrelated — a float64 cancellation on a shared counter, not a port problem.