Skip to content

std::net tests fail in nextest: Address already in use #156377

@RalfJung

Description

@RalfJung

The net tests currently use this logic to pick unique ports for each test. However, that logic fails when tests are executed by nextest as then, each test runs in its own process, so they all end up using the same port.

Running std tests in nextest is quite useful for Miri to get a list of all failed tests, not just the first failed test. I am not sure if there's other good reasons to run std tests in nextest, or how one would even do that (I did it via this).

I wonder why ports are assigned this way. Couldn't the tests instead use port 0 (so that the OS picks a fresh port) and then call local_addr() to figure out which port was actually used, and use that for connect?

Cc @the8472

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions