Skip to content

test(relay): harden regional rehome race coverage - #20136

Merged
Jinwoo-H merged 1 commit into
mainfrom
relay-rehome-followup
Sep 11, 2026
Merged

Jinwoo-H merged 1 commit into
mainfrom
relay-rehome-followup

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 0
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1

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.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: d928462b-f304-4e44-8939-31a87c1808b1

📥 Commits

Reviewing files that changed from the base of the PR and between cd9aa43 and 0cd5530.

📒 Files selected for processing (2)
  • cloud/apps/relay/src/assignment-store.ts
  • cloud/apps/relay/src/regional-rehome-store.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

The 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 0cd55

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)

Check name Status Explanation Resolution
Description check ⚠️ Warning 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 upstrea… Complete the required template sections. Include an ELI5 summary, detailed change and rationale, the linked issue in the required format, Visual Proof with N/A and a reason, testing details and checkbox status, applicable AI disclosure, r…
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies a relay test change that hardens regional rehome race coverage. It matches the main purpose of the pull request.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

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 N/A and a reason, testing details and checkbox status, applicable AI disclosure, review and boundary checks, notes on compatibility and performance, and the checklist results.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Stable scan anchor — hookAfterCandidateScan now detects the candidate scan by its leading SELECT a.user_id, a.relay_host_id clause instead of the FROM relay_region_rehome_control policy clause. Both substrings appear only in selectIdleRegionalRehomes (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 .catch now 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.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@Jinwoo-H
Jinwoo-H merged commit 1d7bb47 into main Sep 11, 2026
26 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.

1 participant