Skip to content

Flaky test: web-server-health neighbor-port takeover fails in full-suite runs (fixed ports inside the ephemeral range) #436

Closed

Description

@Phototonic

Summary

tests/web-server-health.test.ts → "takes over the port after repeated failed binds" intermittently fails when the whole suite runs, and passes standalone.

Details

The test occupies port 48747 and, with Math.random stubbed, expects takeover of neighbor 48748. Both ports sit inside Linux's default ephemeral port range (32768–60999), so any concurrent outbound connection in a busy full-suite run can transiently hold 48748 and make the takeover bind fail.

Observed once in a full bun test run (866 pass / 1 fail); the file passed standalone and on two subsequent full runs, so it is timing/probabilistic, not deterministic.

Suggestion: move the fixed test ports below the ephemeral range (e.g. 28747/28748) or allocate them at runtime.

Environment

  • opencode-mem version: 2.34.0 (also observed on a 2.33.0-based branch)
  • OpenCode version: N/A
  • OS: Linux

Activity

  1. added a commit that references this issue on Oct 28, 2026
    c38deb1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions