Skip to content

test: fix flaky interop tests - address already in use#3396

Open
dozyio wants to merge 4 commits intolibp2p:mainfrom
dozyio:test/fix-flaky-integration-tests
Open

test: fix flaky interop tests - address already in use#3396
dozyio wants to merge 4 commits intolibp2p:mainfrom
dozyio:test/fix-flaky-integration-tests

Conversation

@dozyio
Copy link
Collaborator

@dozyio dozyio commented Mar 3, 2026

Description

Inerop tests were intermittently failing - primarily due to bind: address already in use.

Should hopefully fix some of the flaky tests from here #3387

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if necessary (this includes comments as well)
  • I have added tests that prove my fix is effective or that my feature works

@dozyio dozyio changed the title test: fix flaky integration tests - address already in use test: fix flaky interop tests - address already in use Mar 3, 2026
@dozyio dozyio marked this pull request as ready for review March 3, 2026 20:40
@dozyio dozyio requested a review from a team as a code owner March 3, 2026 20:40
@achingbrain
Copy link
Member

It would be nice to understand why this is happening and fix the root cause, rather than masking it with retries?

@dozyio
Copy link
Collaborator Author

dozyio commented Mar 5, 2026

It would be nice to understand why this is happening and fix the root cause, rather than masking it with retries?

It due to the control port number being assigned ahead of time that clashes when tests are run... seems there is around a 6% chance that ports will clash.

Looked at a few different ways to do it but p2pd doesn't output the actual control port that is used, only the inputted string, so can't pass in 0.

I've updated the PR to use unix domain sockets on non-windows for control instead.

Windows still uses TCP but pre-binds to a port to get an available number

@dozyio dozyio marked this pull request as draft March 5, 2026 05:04
@dozyio dozyio marked this pull request as ready for review March 5, 2026 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants