Skip to content

fix(test): relax dev_mode_port assertion to match get_daemon_port contract#103

Merged
zackees merged 1 commit intomainfrom
fix/88-dev-mode-port-assertion
Apr 18, 2026
Merged

fix(test): relax dev_mode_port assertion to match get_daemon_port contract#103
zackees merged 1 commit intomainfrom
fix/88-dev-mode-port-assertion

Conversation

@zackees
Copy link
Copy Markdown
Member

@zackees zackees commented Apr 18, 2026

Closes #88.

crates/fbuild-paths/src/lib.rs:230 asserted port == 8765 || port == 8865, but get_daemon_port() honors FBUILD_DAEMON_PORT env var and port-file entries — it can legitimately return any u16. Test was flaky whenever a stale port file existed (e.g. ~/.fbuild/prod/daemon/daemon.port holding 18900).

Relaxed to assert!(port > 0) to match the function's public contract. The in-source comment already stated the intent was "returns a valid port" — the strict assertion contradicted that.

Test plan

  • uv run cargo test -p fbuild-paths --lib dev_mode_port
  • uv run cargo test -p fbuild-paths (9 passing)
  • uv run cargo clippy --workspace --all-targets -- -D warnings
  • uv run cargo fmt --all -- --check

🤖 Generated with Claude Code

…tract (closes #88)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 18, 2026

Warning

Rate limit exceeded

@zackees has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 23 minutes and 21 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 23 minutes and 21 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, 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 the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 459650b0-59a2-405c-9a33-6b60e52f461b

📥 Commits

Reviewing files that changed from the base of the PR and between d37995b and 5d6f64a.

📒 Files selected for processing (1)
  • crates/fbuild-paths/src/lib.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/88-dev-mode-port-assertion

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.

@zackees
Copy link
Copy Markdown
Member Author

zackees commented Apr 18, 2026

Superseded by #98 (same fix, merged independently).

@zackees zackees closed this Apr 18, 2026
@zackees zackees deleted the fix/88-dev-mode-port-assertion branch April 18, 2026 17:46
@zackees zackees restored the fix/88-dev-mode-port-assertion branch April 18, 2026 17:49
@zackees zackees reopened this Apr 18, 2026
@zackees zackees merged commit 9fdf434 into main Apr 18, 2026
147 of 152 checks passed
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.

bug(test): fbuild-paths::dev_mode_port asserts against hardcoded defaults but get_daemon_port() allows any port

1 participant