Skip to content

Fix Full Suite test failures: productivity fixtures + delete teardown race - #1689

Merged
gsxdsm merged 1 commit into
mainfrom
gsxdsm/fix-full-tests
Jun 20, 2026
Merged

Fix Full Suite test failures: productivity fixtures + delete teardown race#1689
gsxdsm merged 1 commit into
mainfrom
gsxdsm/fix-full-tests

Conversation

@gsxdsm

@gsxdsm gsxdsm commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

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 a hoursSaved field that ProductivityArea.tsx:77 reads unconditionally (data.hoursSaved.unavailable). Two CommandCenter regression fixtures were never updated, so the area threw TypeError: Cannot read properties of undefined (reading 'unavailable'). That uncaught exception:

  • crashed the CommandCenter render → CommandCenter.mobile-scroll / CommandCenter.tablet-layout couldn't find [data-testid="command-center"], and
  • polluted the shared vitest worker → 3 collateral QuickEntryBox failures (which pass cleanly in isolation).

Fix: add hoursSaved to 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.ts flaked with ENOTEMPTY: ... rmdir '.../.fusion'. The delete handler is fire-and-forget (void this.handleTaskDeleted), so a trailing async write into .fusion races afterEach's rm.

Fix: make rm tolerant via the built-in maxRetries/retryDelay options.

Verification (local)

  • CommandCenter layout tests: 11/11 pass
  • QuickEntryBox: 247/247 pass
  • github-tracking-delete: 9/9 pass

🤖 Generated with Claude Code


Open in Stage

Summary by CodeRabbit

  • Tests
    • Updated test fixtures to include new data fields for improved test coverage.
    • Enhanced test cleanup logic with retry handling to improve test reliability.

… 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>
@ghost

ghost commented Jun 20, 2026

Copy link
Copy Markdown

Ready to review this PR? Stage has broken it down into 2 individual chapters for you:

Title
1 Update productivity fixtures for CommandCenter tests
2 Fix teardown race in GitHub tracking tests
Open in Stage

Chapters generated by Stage for commit a3be235 on Jun 20, 2026 4:15am UTC.

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Two CommandCenter test files (mobile-scroll and tablet-layout) add an hoursSaved field to both populated and empty productivity mock fixtures. A separate test file for GitHub tracking deletion updates the afterEach teardown to use rm with maxRetries and retryDelay to handle ENOTEMPTY errors from async .fusion writes.

Changes

CommandCenter productivity fixture updates

Layer / File(s) Summary
Add hoursSaved to productivity fixtures
packages/dashboard/app/components/command-center/__tests__/CommandCenter.mobile-scroll.test.tsx, packages/dashboard/app/components/command-center/__tests__/CommandCenter.tablet-layout.test.tsx
populatedProductivityFixture gains hoursSaved: { value: <number>, unavailable: false } and emptyProductivityFixture gains hoursSaved: { value: null, unavailable: true } in both test files.

GitHub tracking delete teardown fix

Layer / File(s) Summary
Resilient afterEach directory cleanup
packages/dashboard/src/__tests__/github-tracking-delete.test.ts
rm calls for rootDir and globalDir now include maxRetries: 5, retryDelay: 50 with a comment explaining the ENOTEMPTY race condition from fire-and-forget delete handlers.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐇 A field called hoursSaved hops into the test,
Populated or empty, it's dressed at its best.
And over in teardown, a retry or five
Keeps ENOTEMPTY from taking a dive.
Small fixes, clean burrows — the warren is tidy,
Signed with a paw-print, yours truly, the bunny! 🐾

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title directly and accurately summarizes the two main changes: fixing productivity fixtures (hoursSaved field) and addressing a delete teardown race condition.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch gsxdsm/fix-full-tests

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 and usage tips.

@greptile-apps

greptile-apps Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes five test failures across two shards by patching two categories of test infrastructure issues. No production code is changed.

  • Productivity fixture gap (Shard 4): hoursSaved is added to the populatedProductivityFixture and emptyProductivityFixture helpers in both CommandCenter.mobile-scroll.test.tsx and CommandCenter.tablet-layout.test.tsx, matching the shape expected by ProductivityArea.tsx after commit 59d3eee7f. Without this field the component threw a TypeError on render, which cascaded into five failures including three collateral QuickEntryBox failures from worker state pollution.
  • Teardown race condition (Shard 2): afterEach in github-tracking-delete.test.ts now passes maxRetries: 5, retryDelay: 50 to both rm calls, making cleanup tolerant of in-flight async writes from the fire-and-forget handleTaskDeleted handler that could race the directory removal and produce ENOTEMPTY.

Confidence Score: 5/5

Test-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

Filename Overview
packages/dashboard/app/components/command-center/tests/CommandCenter.mobile-scroll.test.tsx Adds hoursSaved to both productivity fixture helpers; fixes the TypeError that crashed 3+ tests in this file.
packages/dashboard/app/components/command-center/tests/CommandCenter.tablet-layout.test.tsx Identical hoursSaved fixture patch as the mobile-scroll companion file; no other changes.
packages/dashboard/src/tests/github-tracking-delete.test.ts Adds maxRetries: 5, retryDelay: 50 to both afterEach rm calls to tolerate ENOTEMPTY from the fire-and-forget delete handler; fixes the shard-2 flake.

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 ✅
Loading
%%{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 ✅
Loading

Reviews (1): Last reviewed commit: "Fix Full Suite test failures: productivi..." | Re-trigger Greptile

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (3)
packages/dashboard/app/components/command-center/__tests__/CommandCenter.tablet-layout.test.tsx (1)

108-108: ⚡ Quick win

Add the required FNXC_LOG/FNXC comment for this updated test contract.

The fixture change introduces/encodes a requirement (hoursSaved availability contract), but the touched block is missing the required FNXC_LOG timestamped note and FNXC:Area-of-product comment 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 win

Add the required FNXC_LOG/FNXC comment for this fixture update.

These test changes update requirements (new hoursSaved fixture contract), but there’s no FNXC_LOG comment capturing the change timestamp (yyyy-MM-dd-hh:mm) and no FNXC:Area-of-product prefix 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 win

Use 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:mm format for comments in packages/**.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0c0fda1 and a3be235.

📒 Files selected for processing (3)
  • packages/dashboard/app/components/command-center/__tests__/CommandCenter.mobile-scroll.test.tsx
  • packages/dashboard/app/components/command-center/__tests__/CommandCenter.tablet-layout.test.tsx
  • packages/dashboard/src/__tests__/github-tracking-delete.test.ts

@gsxdsm
gsxdsm merged commit 6c9e755 into main Jun 20, 2026
6 checks passed
@gsxdsm
gsxdsm deleted the gsxdsm/fix-full-tests branch July 24, 2026 06:08
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