From a3be2351d13bcd4cf1525f57f577fc9053197c0e Mon Sep 17 00:00:00 2001 From: gsxdsm Date: Fri, 19 Jun 2026 21:09:12 -0700 Subject: [PATCH] Fix Full Suite test failures: productivity fixtures + delete teardown 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) --- .../__tests__/CommandCenter.mobile-scroll.test.tsx | 2 ++ .../__tests__/CommandCenter.tablet-layout.test.tsx | 2 ++ .../dashboard/src/__tests__/github-tracking-delete.test.ts | 7 +++++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/dashboard/app/components/command-center/__tests__/CommandCenter.mobile-scroll.test.tsx b/packages/dashboard/app/components/command-center/__tests__/CommandCenter.mobile-scroll.test.tsx index 4b7062ba72..f9e0257ae8 100644 --- a/packages/dashboard/app/components/command-center/__tests__/CommandCenter.mobile-scroll.test.tsx +++ b/packages/dashboard/app/components/command-center/__tests__/CommandCenter.mobile-scroll.test.tsx @@ -117,6 +117,7 @@ function populatedProductivityFixture() { commits: 2, pullRequests: 1, loc: { value: 42, unavailable: false }, + hoursSaved: { value: 3, unavailable: false }, taskDuration: { completedTasks: 2, averageMs: 1_800_000, @@ -135,6 +136,7 @@ function emptyProductivityFixture() { commits: 0, pullRequests: 0, loc: { value: null, unavailable: true }, + hoursSaved: { value: null, unavailable: true }, taskDuration: { completedTasks: 0, averageMs: null, diff --git a/packages/dashboard/app/components/command-center/__tests__/CommandCenter.tablet-layout.test.tsx b/packages/dashboard/app/components/command-center/__tests__/CommandCenter.tablet-layout.test.tsx index 9d43a335e2..1f516a8545 100644 --- a/packages/dashboard/app/components/command-center/__tests__/CommandCenter.tablet-layout.test.tsx +++ b/packages/dashboard/app/components/command-center/__tests__/CommandCenter.tablet-layout.test.tsx @@ -105,6 +105,7 @@ function populatedProductivityFixture() { commits: 2, pullRequests: 1, loc: { value: 42, unavailable: false }, + hoursSaved: { value: 3, unavailable: false }, taskDuration: { completedTasks: 2, averageMs: 1_800_000, @@ -123,6 +124,7 @@ function emptyProductivityFixture() { commits: 0, pullRequests: 0, loc: { value: null, unavailable: true }, + hoursSaved: { value: null, unavailable: true }, taskDuration: { completedTasks: 0, averageMs: null, diff --git a/packages/dashboard/src/__tests__/github-tracking-delete.test.ts b/packages/dashboard/src/__tests__/github-tracking-delete.test.ts index b84e232ef8..e8fc7181be 100644 --- a/packages/dashboard/src/__tests__/github-tracking-delete.test.ts +++ b/packages/dashboard/src/__tests__/github-tracking-delete.test.ts @@ -106,8 +106,11 @@ describe("github tracking delete flow", () => { afterEach(async () => { stateService.stop(); store.close(); - await rm(rootDir, { recursive: true, force: true }); - await rm(globalDir, { recursive: true, force: true }); + // 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. + await rm(rootDir, { recursive: true, force: true, maxRetries: 5, retryDelay: 50 }); + await rm(globalDir, { recursive: true, force: true, maxRetries: 5, retryDelay: 50 }); }); it("closes the linked issue as not_planned when a tracked task is deleted", async () => {