Skip to content

test: branch-relay-channel tcp case can lose its freePort() port before binding (EADDRINUSE) #889

Open

Description

@tps-flint

packages/cli/test/branch-relay-channel.test.ts "branch relay authenticated channels > tcp inbox delivery keys and reconnects" failed once in the Docker Integration lane (run 42557973361, on a change that touched only two comments) with Failed to listen at 0.0.0.0 ... port: 33433, code: "EADDRINUSE". The case takes a port from freePort(), writes it into the branch config, and the branch binds it later, so another test can take the port in between.

What the fix does: the case retries the start on EADDRINUSE with a newly chosen port, a bounded number of times, failing with the last error if every attempt collides; or the branch is started on port 0 and the test reads back the bound port. Same for any sibling case in that file that uses the same pattern. Run the file repeatedly in the Docker lane to show it stable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions