Skip to content

test: challenge & mintpass integration tests use RPC ports in Linux ephemeral range (EADDRINUSE CI flake) #73

@Rinse12

Description

@Rinse12

Summary

Two integration test files hardcode RPC ports inside Linux's default ephemeral range (32768–60999), so an unrelated outbound socket on the CI runner can grab the port before the daemon binds it, causing a spurious EADDRINUSE and a failed test run:

  • test/cli/mintpass-integration.test.ts:19RPC_PORT = 59238
  • test/cli/challenge-integration.test.ts:21RPC_PORT = 59138

Evidence

Observed on a confidence re-run of PR #71 (ubuntu-latest, run 27090701580):

FAIL  test/cli/mintpass-integration.test.ts > @bitsocial/mintpass-challenge integration tests
Daemon failed to start: listen EADDRINUSE: address already in use :::59238

The test under test was unrelated to the failure — the daemon simply couldn't bind its RPC port because another process on the runner transiently held it.

Root cause

This is the same class of flake fixed previously in 470d317 ("test(daemon): move RPC ports out of Linux ephemeral range to fix CI flake"), which moved the daemon.test.ts ports into a clean 9148–9208 block below every platform's ephemeral floor (Linux 32768, macOS/Windows 49152). The two challenge integration test files (added later) reintroduced ports in the ephemeral range.

Fix

Move both ports out of the ephemeral range into the established 91xx/93xx/95xx/96xx convention used by the other test files, picking values not already taken (existing: 9148–9208, 9338/9348/9358, 9438, 9538/9548, 9638/9648, 9748). Verify the chosen ports don't collide with any other test file or src default, then run npm run test:cli to confirm.

Note: only the RPC ports sit in the ephemeral range; the kubo API / gateway ports in these files (5xxxx/6xxx) are already outside it, matching the other test files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions