Repository navigation
test(relay): harden regional rehome race coverage - #20136
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe change documents that invariant failures during expired evacuation cleanup remain fatal. It also updates the regional rehome test hook to detect the candidate-selection SQL query. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to This PR only clarifies existing cleanup semantics and retargets test coverage, with no remaining merge-blocking risk. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation The description summarizes the code and test changes, but it omits most required template sections, including ELI5, What Changed, Why, Visual Proof, Testing, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist. Resolution Complete the required template sections. Include an ELI5 summary, detailed change and rationale, the linked issue in the required format, Visual Proof with
✨ Finishing Touches📝 Generate docstrings
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.
✅ No new issues found.
Reviewed changes
- Stable scan anchor —
hookAfterCandidateScannow detects the candidate scan by its leadingSELECT a.user_id, a.relay_host_idclause instead of theFROM relay_region_rehome_control policyclause. Both substrings appear only inselectIdleRegionalRehomes(cloud/apps/relay/src/idle-regional-rehome-selection.ts:32), so the hook still fires on exactly that query; the SELECT prefix is the more durable anchor against future join/alias edits. - Clarifying comment — the abort-expired-evacuations
.catchnow documents that non-lock errors (!isDatabaseLockUnavailable(error)) are re-thrown so corrupt migration state fails loudly rather than being swallowed.
The two tests using the hook still guard real assertions (both expect(...).toBeNull() on a would-be commit), so a broken anchor would fail the suite rather than silently pass. No behavior change to the idle cutover path.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

Follow-up to #20105. Use a stable production-query anchor in the scan/claim race test and document why invariant failures remain fatal during expired-migration cleanup. No behavior change to the idle cutover path.