Repository navigation
test: guard package install lock wait status - #620
Conversation
|
Warning Review limit reached
More reviews will be available in 36 minutes. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the 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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA new import ( ChangesWaitingForLock Status Subscriber Test
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/fbuild-packages/src/install_lock.rs`:
- Around line 239-245: The test uses a fixed 50ms sleep followed by a single
check for the expected status, which is unreliable under CI load and can fail
before the waiter publishes the status. Replace the fixed sleep and single
assertion with a bounded polling loop that repeatedly checks the shared seen
events until either the expected status (with name "framework", version "3.0",
and phase WaitingForLock) is found or a reasonable timeout is exceeded. This
makes the test deterministic by waiting as long as needed (within bounds) rather
than relying on precise timing.
- Around line 225-255: The test sets up a global install-status subscriber with
set_install_status_subscriber but the corresponding
clear_install_status_subscriber call at the end is not guaranteed to run if an
assertion panics earlier, leaving the subscriber registered for subsequent
tests. Make the subscriber cleanup panic-safe by wrapping it in a guard or scope
mechanism that implements Drop behavior to ensure
clear_install_status_subscriber is always called regardless of panics,
preventing global state leakage between tests.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 8f712e9f-0e1d-4d81-9f0e-e66617c35e76
📒 Files selected for processing (1)
crates/fbuild-packages/src/install_lock.rs
7947849 to
131efb6
Compare
131efb6 to
ff46db8
Compare
Summary
waiting_for_lockphase,waiterrole, lock path, and human wait messageTests
Reference #603
Summary by CodeRabbit