Fix Full Suite test failures: productivity fixtures + delete teardown race - #1689
Conversation
… race Three failures in the non-blocking Full Suite: - CommandCenter mobile-scroll / tablet-layout regression tests rendered with productivity fixtures missing the `hoursSaved` field added in FN-6721. That made ProductivityArea throw on `data.hoursSaved.unavailable`, an uncaught exception that crashed the CommandCenter render (no `command-center` testid) and polluted the shared worker, causing collateral QuickEntryBox failures. Add `hoursSaved` to both fixtures. - github-tracking-delete route test failed intermittently with `ENOTEMPTY: ... rmdir '.../.fusion'` because the fire-and-forget delete handler can write into `.fusion` while afterEach removes the temp dir. Make rm tolerant via maxRetries/retryDelay. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Ready to review this PR? Stage has broken it down into 2 individual chapters for you:
Chapters generated by Stage for commit a3be235 on Jun 20, 2026 4:15am UTC. |
📝 WalkthroughWalkthroughTwo CommandCenter test files (mobile-scroll and tablet-layout) add an ChangesCommandCenter productivity fixture updates
GitHub tracking delete teardown fix
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 fixes five test failures across two shards by patching two categories of test infrastructure issues. No production code is changed.
Confidence Score: 5/5Test-only changes that fix deterministic TypeError crashes and a teardown race; no production code is touched. All three files are pure test infrastructure. The productivity fixture additions are a straightforward schema sync — the new field matches the shape already used in areas.test.tsx. The rm retry approach is well-scoped to afterEach and only activates on ENOTEMPTY, so it cannot interfere with test assertions. A repo-wide grep confirms no other productivity fixtures are missing hoursSaved. No files require special attention. Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant T as Test (afterEach)
participant S as stateService.stop()
participant H as handleTaskDeleted (async)
participant FS as Filesystem (.fusion dir)
Note over T,FS: Before fix — ENOTEMPTY race
T->>S: stop()
T->>FS: "rm(rootDir, {recursive,force})"
H-->>FS: async write (still in-flight)
FS-->>T: ENOTEMPTY ❌
Note over T,FS: After fix — retry-tolerant cleanup
T->>S: stop()
T->>FS: "rm(rootDir, {recursive,force,maxRetries:5,retryDelay:50})"
H-->>FS: async write (still in-flight)
FS-->>T: ENOTEMPTY → retry (up to 5×, 50 ms apart)
FS-->>T: success ✅
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant T as Test (afterEach)
participant S as stateService.stop()
participant H as handleTaskDeleted (async)
participant FS as Filesystem (.fusion dir)
Note over T,FS: Before fix — ENOTEMPTY race
T->>S: stop()
T->>FS: "rm(rootDir, {recursive,force})"
H-->>FS: async write (still in-flight)
FS-->>T: ENOTEMPTY ❌
Note over T,FS: After fix — retry-tolerant cleanup
T->>S: stop()
T->>FS: "rm(rootDir, {recursive,force,maxRetries:5,retryDelay:50})"
H-->>FS: async write (still in-flight)
FS-->>T: ENOTEMPTY → retry (up to 5×, 50 ms apart)
FS-->>T: success ✅
Reviews (1): Last reviewed commit: "Fix Full Suite test failures: productivi..." | Re-trigger Greptile |
There was a problem hiding this comment.
🧹 Nitpick comments (3)
packages/dashboard/app/components/command-center/__tests__/CommandCenter.tablet-layout.test.tsx (1)
108-108: ⚡ Quick winAdd the required FNXC_LOG/FNXC comment for this updated test contract.
The fixture change introduces/encodes a requirement (
hoursSavedavailability contract), but the touched block is missing the requiredFNXC_LOGtimestamped note andFNXC:Area-of-productcomment prefix.As per coding guidelines, “Add FNXC_LOG comments whenever working on the codebase, describing the date in format yyyy-MM-dd-hh:mm and requirements or changes in requirements” and “Write FNXC:Area-of-product in front of all comments for grep-ability.”
Also applies to: 127-127
🤖 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/command-center/__tests__/CommandCenter.tablet-layout.test.tsx` at line 108, The test fixture in CommandCenter.tablet-layout.test.tsx is missing required FNXC documentation comments for the updated test contract. Add a FNXC_LOG comment with a timestamp in yyyy-MM-dd-hh:mm format describing the hoursSaved availability requirement change, and prefix it with FNXC:Area-of-product for grep-ability. Apply this same comment pattern to both the touched block around line 108 and the other occurrence mentioned at line 127. The comment should clearly document what requirement or change is being encoded in the fixture modification.Source: Coding guidelines
packages/dashboard/app/components/command-center/__tests__/CommandCenter.mobile-scroll.test.tsx (1)
120-120: ⚡ Quick winAdd the required FNXC_LOG/FNXC comment for this fixture update.
These test changes update requirements (new
hoursSavedfixture contract), but there’s noFNXC_LOGcomment capturing the change timestamp (yyyy-MM-dd-hh:mm) and noFNXC:Area-of-productprefix comment in the touched area.As per coding guidelines, “Add FNXC_LOG comments whenever working on the codebase, describing the date in format yyyy-MM-dd-hh:mm and requirements or changes in requirements” and “Write FNXC:Area-of-product in front of all comments for grep-ability.”
Also applies to: 139-139
🤖 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/command-center/__tests__/CommandCenter.mobile-scroll.test.tsx` at line 120, The fixture update adding the hoursSaved property in the CommandCenter.mobile-scroll.test.tsx test file is missing required FNXC_LOG comments. Add a FNXC_LOG comment with a timestamp in yyyy-MM-dd-hh:mm format and a description of the fixture contract change (adding the new hoursSaved requirement), prefixed with FNXC:Area-of-product for grep-ability. Apply this comment to both locations mentioned (line 120 where hoursSaved is being added to the fixture, and also at line 139 where a similar change applies).Source: Coding guidelines
packages/dashboard/src/__tests__/github-tracking-delete.test.ts (1)
109-111: ⚡ Quick winUse the required FNXC comment format for teardown rationale (Line 109).
The new comment explains the race correctly, but it does not follow the required
FNXC:Area-of-product yyyy-MM-dd-hh:mmformat for comments inpackages/**.Suggested patch
- // The delete handlers are fire-and-forget (`void this.handleTaskDeleted`), so a - // trailing async write into `.fusion` can race this cleanup and surface as - // ENOTEMPTY. `maxRetries`/`retryDelay` make rm tolerant of that teardown race. + /* + FNXC:DashboardTests 2026-06-20-00:00: + Delete handlers are fire-and-forget (`void this.handleTaskDeleted`), so trailing async + writes into `.fusion` can race teardown and raise ENOTEMPTY; retry-enabled rm keeps cleanup stable. + */As per coding guidelines, "Add FNXC_LOG comments whenever working on the codebase, describing the date in format yyyy-MM-dd-hh:mm and requirements or changes in requirements" and "Write FNXC:Area-of-product in front of all comments for grep-ability."
🤖 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/src/__tests__/github-tracking-delete.test.ts` around lines 109 - 111, The comment block explaining the race condition between delete handlers and async writes does not follow the required FNXC format for the packages directory. Update the comment starting with "The delete handlers are fire-and-forget" to include the FNXC:Area-of-product yyyy-MM-dd-hh:mm prefix at the beginning, where Area-of-product should be replaced with the relevant product area and the timestamp should use the current date and time in the specified format. This ensures the comment is grep-able and follows the coding guidelines for comments in the packages directory.Source: Coding guidelines
🤖 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.
Nitpick comments:
In
`@packages/dashboard/app/components/command-center/__tests__/CommandCenter.mobile-scroll.test.tsx`:
- Line 120: The fixture update adding the hoursSaved property in the
CommandCenter.mobile-scroll.test.tsx test file is missing required FNXC_LOG
comments. Add a FNXC_LOG comment with a timestamp in yyyy-MM-dd-hh:mm format and
a description of the fixture contract change (adding the new hoursSaved
requirement), prefixed with FNXC:Area-of-product for grep-ability. Apply this
comment to both locations mentioned (line 120 where hoursSaved is being added to
the fixture, and also at line 139 where a similar change applies).
In
`@packages/dashboard/app/components/command-center/__tests__/CommandCenter.tablet-layout.test.tsx`:
- Line 108: The test fixture in CommandCenter.tablet-layout.test.tsx is missing
required FNXC documentation comments for the updated test contract. Add a
FNXC_LOG comment with a timestamp in yyyy-MM-dd-hh:mm format describing the
hoursSaved availability requirement change, and prefix it with
FNXC:Area-of-product for grep-ability. Apply this same comment pattern to both
the touched block around line 108 and the other occurrence mentioned at line
127. The comment should clearly document what requirement or change is being
encoded in the fixture modification.
In `@packages/dashboard/src/__tests__/github-tracking-delete.test.ts`:
- Around line 109-111: The comment block explaining the race condition between
delete handlers and async writes does not follow the required FNXC format for
the packages directory. Update the comment starting with "The delete handlers
are fire-and-forget" to include the FNXC:Area-of-product yyyy-MM-dd-hh:mm prefix
at the beginning, where Area-of-product should be replaced with the relevant
product area and the timestamp should use the current date and time in the
specified format. This ensures the comment is grep-able and follows the coding
guidelines for comments in the packages directory.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: a0f4a169-1621-4a5b-9231-bfc9da17fd12
📒 Files selected for processing (3)
packages/dashboard/app/components/command-center/__tests__/CommandCenter.mobile-scroll.test.tsxpackages/dashboard/app/components/command-center/__tests__/CommandCenter.tablet-layout.test.tsxpackages/dashboard/src/__tests__/github-tracking-delete.test.ts
Summary
Fixes all failures in the non-blocking Full Suite workflow (shards 2 and 4). Test-only changes — no shipped behavior changes.
Shard 4 — 5 failures, one root cause
Commit
59d3eee7f(FN-6721) added ahoursSavedfield thatProductivityArea.tsx:77reads unconditionally (data.hoursSaved.unavailable). Two CommandCenter regression fixtures were never updated, so the area threwTypeError: Cannot read properties of undefined (reading 'unavailable'). That uncaught exception:CommandCenter.mobile-scroll/CommandCenter.tablet-layoutcouldn't find[data-testid="command-center"], andQuickEntryBoxfailures (which pass cleanly in isolation).Fix: add
hoursSavedto the populated/empty productivity fixtures in both test files. Swept the repo — no other fixtures missing it.Shard 2 — 1 failure
github-tracking-delete.test.tsflaked withENOTEMPTY: ... rmdir '.../.fusion'. The delete handler is fire-and-forget (void this.handleTaskDeleted), so a trailing async write into.fusionracesafterEach'srm.Fix: make
rmtolerant via the built-inmaxRetries/retryDelayoptions.Verification (local)
🤖 Generated with Claude Code
Summary by CodeRabbit