Skip to content

io_uring unit tests hard code a port to listen on, which is very naughty #14907

@andrewrk

Description

@andrewrk

const address_server = try net.Address.parseIp4("127.0.0.1", 3131);

const address = try net.Address.parseIp4("127.0.0.1", 3131);

const address = try net.Address.parseIp4("127.0.0.1", 3131);

You can't just grab some arbitrary port and start using it in unit tests. That port could be used by the system causing the unit tests to fail with EADDRINUSE. Or... it could be used by the very same unit tests, in another process, which is the situation happening now, in #14647. Unit tests must bind to port 0, letting the operating system assign a port, and then use that port for testing.

I will now disable all of these tests that hard code a port number.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behaviorcontributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.standard libraryThis issue involves writing Zig code for the standard library.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions