Skip to content

test(daemon): move RPC ports out of Linux ephemeral range to fix CI flake#57

Open
Rinse12 wants to merge 1 commit into
masterfrom
fix/daemon-test-rpc-ports-out-of-ephemeral-range
Open

test(daemon): move RPC ports out of Linux ephemeral range to fix CI flake#57
Rinse12 wants to merge 1 commit into
masterfrom
fix/daemon-test-rpc-ports-out-of-ephemeral-range

Conversation

@Rinse12
Copy link
Copy Markdown
Member

@Rinse12 Rinse12 commented May 25, 2026

Summary

  • Move 7 hardcoded RPC ports in test/cli/daemon.test.ts (11138, 19138, 29138, 39138, 49138, 59338, 59339) into a clean 9148 – 9208 block.
  • All previously sat inside Linux's default ephemeral range (32768 – 60999), so any outbound TCP socket on the runner could grab one as its source port and cause EADDRINUSE when the daemon tried to listen(). This is what made master run 26397296711 fail on ubuntu-latest (Daemon failed to start: listen EADDRINUSE :::39138).
  • The new range sits below every matrix OS's ephemeral floor (Linux 32768, macOS/Windows 49152) and does not collide with any other test file or src/common-utils/defaults.ts (9138 is the daemon's default RPC).

Closes #54

Test plan

  • npm run build:test passes
  • npx vitest run --config config/vitest.config.ts test/cli/daemon.test.ts — 22/22 tests pass locally in 158s
  • CI matrix (ubuntu-latest / macos-latest / windows-latest) green

Out of scope

The 50xxx Kubo ports in this file are also inside the Linux ephemeral range but haven't flaked yet — happy to do a follow-up if desired.

…lake

Ubuntu CI was flaking on the `bitsocial daemon webui` suite with
`EADDRINUSE :::39138` during `beforeAll`. The hardcoded RPC ports
11138/19138/29138/39138/49138/59338/59339 all sit inside Linux's
default ephemeral range (32768-60999), so an unrelated outbound
socket on the runner could grab the port before the daemon bound it.

Move them to a clean 9148-9208 block, below every platform's
ephemeral floor (Linux 32768, macOS/Windows 49152) and not used by
any other test file or src default.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 25, 2026

Warning

Review limit reached

@Rinse12, we couldn't start this review because you've used your available PR reviews for now.

Your plan includes 1 review of capacity. Refill in 59 minutes and 54 seconds.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more review capacity refills, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fdf5bdae-7681-429d-a51b-4dd12bbf7337

📥 Commits

Reviewing files that changed from the base of the PR and between 95aec49 and 470d317.

📒 Files selected for processing (1)
  • test/cli/daemon.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/daemon-test-rpc-ports-out-of-ephemeral-range

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI flake: daemon.test.ts RPC ports inside Linux ephemeral range cause EADDRINUSE

1 participant