Skip to content

[Flaky Test] hermetic integration tests fail with "Server failed to bind port" #1066

Description

@yankay

What happened:

The hermetic integration tests under test/integration/epp/ flake intermittently on CI with Server failed to bind port 127.0.0.1:<port> errors, causing lint-and-test to fail on unrelated PRs.

Observed in at least:

Failure signature (different sub-tests, same root cause):

Error:    Condition never satisfied
Messages: Server failed to bind port 127.0.0.1:<random-port>

What you expected to happen:

Hermetic integration tests should pass deterministically on CI without flaking due to port allocation races.

How to reproduce it (as minimally and precisely as possible):

Flaky — run lint-and-test repeatedly on a PR; intermittently a sub-test of TestFullDuplexStreamed_* fails with the bind-port error within its 10s budget.

Anything else we need to know?:

Likely cause: the random-port allocation in the hermetic test fixture races with another process / parallel sub-test on the runner; the 10s bind retry budget expires before the port frees up.

Suggested follow-up:

  • Audit the port-allocation helper in the hermetic harness; prefer a listen-then-pass-fd pattern over allocate-then-bind to avoid the race.
  • Or: increase the retry/timeout budget on bind failures.

Environment:

  • CI: GitHub Actions, ubuntu-latest runner (default lint-and-test workflow).
  • Not environment-specific to a user setup; reproduces on CI only.

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