Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Flaky test - 'reject dial of connection above closeAbove' #250

Open
achingbrain opened this issue Feb 1, 2023 · 0 comments
Open

Flaky test - 'reject dial of connection above closeAbove' #250

achingbrain opened this issue Feb 1, 2023 · 0 comments
Labels
help wanted Seeking public contribution on this issue need/analysis Needs further analysis before proceeding

Comments

@achingbrain
Copy link
Member

CI sometimes breaks on this test https://github.com/libp2p/js-libp2p-tcp/actions/runs/3971032097/jobs/6814690159

  1) close server on maxConnections
       reject dial of connection above closeAbove:
     Socket[1] connect ECONNREFUSED ::1:9900
  Error: connect ECONNREFUSED ::1:9900
      at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1487:16)

The test is supposed to allow the first 3 connections (socket[1], socket[2], socket[3]). However, the first attempted socket fails to connect as apparently the server is not listening. The server should listen here and this promise resolve only when sockets can connect.

await listener.listen(multiaddr(`/ip4/127.0.0.1/tcp/${port}`))

From what I can see in the test, the error message comes from this line. The socket is created here and attempts to connect to the port listened on here, so the .listen function may be returning before the socket is fully open? Maybe something OS-specific?

@achingbrain achingbrain added help wanted Seeking public contribution on this issue need/analysis Needs further analysis before proceeding labels Feb 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Seeking public contribution on this issue need/analysis Needs further analysis before proceeding
Projects
None yet
Development

No branches or pull requests

1 participant