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

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

@achingbrain

Description

@achingbrain

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedSeeking public contribution on this issueneed/analysisNeeds further analysis before proceeding

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions