Skip to content

e2e: free_port() TOCTOU can cause intermittent port-collision flakes #1065

Closed

Description

@yigitdot

Surfaced by the multi-agent review of #1053 (#1028).

crates/e2e/src/lib.rs free_port() binds an ephemeral TCP port, drops the listener, then hands the number to anvil / the daemon. Between release and re-bind another process can claim the port. It's used ~4x per node run, so under parallel test load this is a real (if low-probability) intermittent flake — and now also gates chain_id uniqueness (#1053 derives chain_id = CHAIN_BASE + port).

Options: hold the listener until the child binds (SO_REUSEADDR handoff), retry on bind failure, or accept + document. Deferred from #1053.

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

Metadata

Metadata

Assignees

Labels

prio:medium

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions