fix(ci): quarantine CLI lock-retry flakes + settle planning tab-lock#2305
Conversation
Full Suite after FN-8271: shard 4 re-failed mcp/task-lock-retry under package lane load (5s timeouts); shard 3 failed planning tab-lock when Small+Continue missed respond under load. Quarantine lock-retry on sight; settle radio selection.
📝 WalkthroughWalkthroughThe PR quarantines two flaky CLI lock-retry tests and updates a dashboard planning-flow test to use accessible selectors, explicit state synchronization, and a bounded response assertion. ChangesTest stability updates
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Greptile SummaryThis PR quarantines two load-sensitive CLI tests and adjusts the planning-flow interaction test. The main changes are:
Confidence Score: 5/5The production paths are unchanged, with one non-blocking test cleanup remaining.
packages/dashboard/app/components/tests/PlanningModeModal.planning-flow.test.tsx Important Files Changed
Reviews (1): Last reviewed commit: "fix(ci): quarantine CLI lock-retry flake..." | Re-trigger Greptile |
| await waitFor( | ||
| () => { | ||
| expect(mockRespondToPlanning).toHaveBeenCalledWith( | ||
| "session-123", | ||
| { "q-scope": "small" }, | ||
| undefined, | ||
| ); | ||
| }, | ||
| { timeout: 3000 }, | ||
| ); |
There was a problem hiding this comment.
The radio check already waits for the state that enables Continue, but the response assertion also raises the timeout from the default to three seconds. Under slower shard scheduling this remains an arbitrary failure threshold, and it violates the repository rule against widening timeouts to appease flaky tests.
| await waitFor( | |
| () => { | |
| expect(mockRespondToPlanning).toHaveBeenCalledWith( | |
| "session-123", | |
| { "q-scope": "small" }, | |
| undefined, | |
| ); | |
| }, | |
| { timeout: 3000 }, | |
| ); | |
| await waitFor(() => { | |
| expect(mockRespondToPlanning).toHaveBeenCalledWith( | |
| "session-123", | |
| { "q-scope": "small" }, | |
| undefined, | |
| ); | |
| }); |
Context Used: AGENTS.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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
`@packages/dashboard/app/components/__tests__/PlanningModeModal.planning-flow.test.tsx`:
- Around line 538-547: Remove the explicit `{ timeout: 3000 }` option from the
`waitFor` assertion in the planning flow test, allowing the repository default
timeout to apply. If the test remains flaky, quarantine it through the project’s
flake ledger and Vitest exclusion mechanism rather than increasing timeouts or
weakening assertions.
🪄 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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: a21d333b-06b9-4950-b372-ffd7b7a9b8d3
📒 Files selected for processing (3)
packages/cli/vitest.config.tspackages/dashboard/app/components/__tests__/PlanningModeModal.planning-flow.test.tsxscripts/lib/test-quarantine.json
| await waitFor( | ||
| () => { | ||
| expect(mockRespondToPlanning).toHaveBeenCalledWith( | ||
| "session-123", | ||
| { "q-scope": "small" }, | ||
| undefined, | ||
| ); | ||
| }, | ||
| { timeout: 3000 }, | ||
| ); |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
Remove the increased timeout.
The addition of { timeout: 3000 } to appease a test flake directly violates the repository's coding guidelines. If this test is flaky under the default timeout, it must be quarantined via the ledger and Vitest exclusion instead of increasing the timeout. As per coding guidelines: "Never appease flakes with larger timeouts, retries, weakened assertions, or deleted assertions."
🛠️ Proposed fix to remove the timeout
- await waitFor(
- () => {
- expect(mockRespondToPlanning).toHaveBeenCalledWith(
- "session-123",
- { "q-scope": "small" },
- undefined,
- );
- },
- { timeout: 3000 },
- );
+ await waitFor(() => {
+ expect(mockRespondToPlanning).toHaveBeenCalledWith(
+ "session-123",
+ { "q-scope": "small" },
+ undefined,
+ );
+ });📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| await waitFor( | |
| () => { | |
| expect(mockRespondToPlanning).toHaveBeenCalledWith( | |
| "session-123", | |
| { "q-scope": "small" }, | |
| undefined, | |
| ); | |
| }, | |
| { timeout: 3000 }, | |
| ); | |
| await waitFor(() => { | |
| expect(mockRespondToPlanning).toHaveBeenCalledWith( | |
| "session-123", | |
| { "q-scope": "small" }, | |
| undefined, | |
| ); | |
| }); |
🤖 Prompt for 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.
In
`@packages/dashboard/app/components/__tests__/PlanningModeModal.planning-flow.test.tsx`
around lines 538 - 547, Remove the explicit `{ timeout: 3000 }` option from the
`waitFor` assertion in the planning flow test, allowing the repository default
timeout to apply. If the test remains flaky, quarantine it through the project’s
flake ledger and Vitest exclusion mechanism rather than increasing timeouts or
weakening assertions.
Source: Coding guidelines
Summary
mcp-lock-retry/task-lock-retry5s timeouts under package-lane loadrespondToPlanningnever called after Small/Continuepackages/cli/vitest.config.ts(no timeout appeasement).waitForon respond.Test plan
Summary by CodeRabbit
Bug Fixes
Tests