Skip to content

server: support --bind :0 and report the bound address, eliminating test port races by design #327

Description

@aaltshuler

The CLI test harness (spawn_server_process, #323) picks a free port by binding 127.0.0.1:0, reading the port, dropping the listener, and having the spawned omnigraph-server rebind it. Any concurrent spawn can steal the port in that window; #323 papers over it with bounded retries. Per the correct-by-design rule (AGENTS.md rule 13), the design fix is for the server to own the bind: accept --bind 127.0.0.1:0, bind first, then report the actual bound address on stdout (or a --port-file <path>) so the harness reads the real port and the race window never exists. When this lands, the retry loop in tests/support/mod.rs reduces to dead code and should be removed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions