Repository navigation
test: stop tests leaving temp dirs and a flake-check fixture behind - #1977
Conversation
Each `cargo test` of src-tauri left two `buzz-spool-ipc-*` dirs in the user temp dir. Each `node --test tests/integration` left three `preview-*` dirs in /tmp. 224 and 48 had built up on one machine. - `isolated_agent_ipc_probe` rooted its `Spools` at a new `temp_dir()/buzz-spool-ipc-<uuid>` dir that nothing removed, and the parent test runs the probe twice on Unix. The root is now a `TempDir` that the probe owns. It is declared before the app, so it is removed after the app drops, including when the probe panics. - The three fixture tests in `preview-feed.test.mjs` never removed their `mkdtempSync` dirs. Each now registers `t.after` cleanup, as `prune-preview-releases.test.mjs` does. Checked by running `relay::tests::real_ipc_restores_identity_signs_and_rejects_invalid_requests` and `node --test tests/integration/preview-feed.test.mjs`. Both pass, and neither left a new dir behind. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Matt Toohey <contact@matttoohey.com>
The parameterized-selection test writes a `flake-selection-*` suite into tests/fixtures/design-system/, including a test that throws if it runs. If a run was interrupted, the suite stayed behind. It was not gitignored, and Vitest's `include` matched it, so every later `vitest run` in that worktree failed. The fixture stays in the repo, because a temp dir would leave the test checking nothing. The test calls the script's real `listVitest`. That runs `vitest list` from the repo root with vitest.config.ts. Vitest collects only files that the include globs match under the root, and a file in /tmp listed `[]` even when named by its absolute path. A plain `exclude` does not work either: Vitest also drops an excluded file that is named by exact path, so the test would list nothing. Instead: - .gitignore ignores `tests/fixtures/design-system/flake-selection-*/`. - vitest.config.ts excludes that pattern, unless BUZZ_FLAKE_CHECK_FIXTURE is set. It keeps Vitest's default excludes. - The test sets the variable for the Vitest processes it starts, and clears it in `t.after`. The dir is already removed in `t.after`. Checked with `node --test tests/integration/flake-check.test.mjs`. All 10 tests pass, so the opt-in reaches `vitest list`. The run left nothing new in tests/fixtures/design-system/ or /tmp. A probe config with the same exclude pattern listed no tests for a fixture named by exact path. So without the opt-in, the test would list nothing and fail its six-location assertion. That case was not run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Matt Toohey <contact@matttoohey.com>
…iome This addresses two review points on 55ab55fa1 and 8d8749173. 55ab55fa1 kept a leftover `flake-selection-*` fixture out of Vitest and gitignored it. `pnpm check` still failed on it: - `design:typecheck` uses tsconfig.design.json, which includes tests/fixtures/design-system. Its `noUnusedLocals` fails with TS6133 on the fixture's `label` and `sibling`. The pre-push design hook runs the same config. - biome.json has `vcs.enabled: false`, so `biome check .` and `pnpm lint` ignore .gitignore. They reported noUnusedVariables and formatting errors in the fixture. tsconfig.design.json now excludes the pattern. biome.json force-ignores it with `!!` in `files.includes`. No other repo-wide check needs it: `design:check`, check-icons and the pre-push hook's guards pass with a leftover present. `design:test` only includes `*.test.ts`, and the fixture is `.test.tsx`. The spool `TempDir` comment in relay/tests.rs said the dir is removed after the app drops. Tauri does not promise to drop managed state with the `App`, so the `Spools` may outlive the dir. The comment now only says the probe owns the dir and removes it when the probe returns or panics. Checked with a copy of the fixture's `cases.test.tsx` and a `result.json` in tests/fixtures/design-system/flake-selection-probe/: - Before: `design:typecheck` failed with the two TS6133 errors. `biome check --error-on-warnings .` failed with 2 errors and 2 warnings, all in the probe. Its other 23 diagnostics are existing infos. - After: both pass. `biome lint --error-on-warnings .` passes too. Biome skips the probe even when the file is named directly. `tsc -p tsconfig.design.json --listFilesOnly` lists all 53 fixture files outside the probe, and none inside it. - `design:check` and check-icons passed with the probe present, before and after. The probe was then deleted. `node --test tests/integration/flake-check.test.mjs` passes all 10 tests, and the run left no `flake-selection-*` dir behind. The tests.rs change is comment-only and was not compiled or run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Matt Toohey <contact@matttoohey.com>
kazemek21
left a comment
There was a problem hiding this comment.
Kyle reviewed this PR and the Nexus review-tracker notes and approved with no comments.
Posted by Codex (gpt-6.1-sol) on behalf of kylez
wesbillman
left a comment
There was a problem hiding this comment.
🤖 Star Lord’s automated source review via Wes’s account, integrating Rocket, Mantis and Groot coverage.
No actionable source defects found in the seven-file test-cleanup and discovery change. Reviewed the probe-owned spool directory, synchronous preview-test children and teardown, and the generated fixture’s opt-in/discovery exclusions across Vitest, TypeScript, Biome and Git. The public description and three commit messages were inspected; no attached images were present.
Reviewed head e2ce3e667de5c363f599aec9164de90d6ee7eb89 against base/merge-base 36a283b2386473130430890faa3b06c6e45d4a6b, using immutable Git objects.
Hosted CI run 41057009921 succeeded on merge 0e5eb6e7fc8ad6bb308245a37134bfdf3aca9259, whose parents are the reviewed base/head and whose tree matches the head. The three Vitest timing artifacts report 13,956 passed, 21 skipped and zero failures; maximum shard command wall time was 488.03s and summed test execution was 1,666.12s (overlapping execution). No before/after timing baseline was collected, so cost regression is unassessed. Windows native and both advisory flake lanes were skipped.
Source-only: no local tests, PR-code execution, app launch or interrupted-run reproduction. Cleanup on forced termination, native Windows behavior and human acceptance remain unverified. No approval or merge-readiness claim.
Picks up the month-boundary StatusEditor test fix (#2064). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * origin/main: (56 commits) perf(sidebar): subscribe to selected live and list facts (#1966) feat(desktop): align the sign-in callback page with web branding (#2038) Show linked PRs in Solo headers and move idle huddles to Chat actions (#1968) feat(messages): mark edited messages with "(edited)" (#2020) feat(desktop): bundle the buzz CLI in every package (#2027) feat(plugins): open a plugin page from buzz://plugin links (#2053) feat(plugins): managed plugin sources (#2052) test(browser): prevent sampled clock pause races (#1955) test: fix month-boundary and Sonner mount races in StatusEditor and RelayStaff tests (#2064) test: stop tests leaving temp dirs and a flake-check fixture behind (#1977) fix(messages): release Virtua's held range when scrolling stops (#2032) test(mcp): allow protection checks in bundled help fixture (#2061) fix(emoji): recover transient image failures without reopening chats (#2000) test: wait for dialog focus, reach a reading position, re-sign pair() (#1975) feat(plugins): sign builderlab in through the native fi session in fi builds (#1461) feat(agents): offer bundled Buzz help (#2033) fix(github): show pull request status for anchors and subpages (#2055) fix(dialogs): focus safe controls and task inputs (#2021) fix(composer): truncate workspace names at narrow widths (#2043) AIDA-2287: Refresh public channel search incrementally (#2023) ... Signed-off-by: Alex Rosenzweig <arosenzweig@squareup.com>
…isibility * origin/main: (23 commits) feat(profiles): show NIP-FI verified names (BUZZ-433) (#2005) feat(identity): sign in to the organization when Buzz opens (#2086) perf(identity-names): stop rerunning name policy for live member churn (#2092) fix(sidebar): keep the channel drag preview under the pointer (#2019) fix(identity): use xyz.block.buzz.desktop federated-session keychain service (#2094) perf(relay): read each channel's remote access once per accepted batch (#2091) fix(styles): keep page status :has() on each rule's subject (#2081) fix(navigation): show a notice for invalid deep links (#2054) fix(messages): preserve held readers through equal-height resizes (#1963) perf(sidebar): subscribe to selected live and list facts (#1966) feat(desktop): align the sign-in callback page with web branding (#2038) Show linked PRs in Solo headers and move idle huddles to Chat actions (#1968) feat(messages): mark edited messages with "(edited)" (#2020) feat(desktop): bundle the buzz CLI in every package (#2027) feat(plugins): open a plugin page from buzz://plugin links (#2053) feat(plugins): managed plugin sources (#2052) test(browser): prevent sampled clock pause races (#1955) test: fix month-boundary and Sonner mount races in StatusEditor and RelayStaff tests (#2064) test: stop tests leaving temp dirs and a flake-check fixture behind (#1977) fix(messages): release Virtua's held range when scrolling stops (#2032) ... # Conflicts: # src/bundled/channels/ChannelMemberAvatars.tsx
Summary
Three tests left files behind. Two left temp dirs on every run, and 224
buzz-spool-ipc-*and 48preview-*dirs had built up on one machine. The flake-check test could leave a fixture suite inside the repo after an interrupted run. That leftover then broke every latervitest run,pnpm checkand lint in that worktree. No product code changes.Temp dirs left on every run (first commit)
isolated_agent_ipc_probe(src-tauri/src/relay/tests.rs) rooted itsSpoolsat a newtemp_dir()/buzz-spool-ipc-<uuid>dir that nothing removed. The parent test runs the probe twice on Unix, so eachcargo testof src-tauri left two dirs. The root is now aTempDirthat the probe owns, and it is removed when the probe returns or panics.tests/integration/preview-feed.test.mjsnever removed theirmkdtempSyncdirs, so eachnode --test tests/integrationleft three in /tmp. Each test now registerst.aftercleanup, asprune-preview-releases.test.mjsdoes.relay::tests::real_ipc_restores_identity_signs_and_rejects_invalid_requestsandnode --test tests/integration/preview-feed.test.mjsboth pass, and neither left a new dir behind.A leftover
flake-selection-*fixture broke later runs (second and third commits)flake-check.test.mjswrites aflake-selection-*suite intotests/fixtures/design-system/. The suite includes a test that throws if it runs. If a run was interrupted, the suite stayed behind. It was not gitignored, and three tools picked it up:includematched it.tsconfig.design.jsonincludestests/fixtures/design-system. ItsnoUnusedLocalsfailed with TS6133 indesign:typecheckand in the pre-push design hook.biome.jsonhasvcs.enabled: false, sobiome check .andpnpm lintignore.gitignore. They reported errors in the fixture.listVitest, which runsvitest listfrom the repo root withvitest.config.ts. Vitest collects only files that its include globs match under the root. A file in /tmp listed[], even when named by its absolute path. A plainexcludedoes not work either, because Vitest also drops an excluded file that is named by exact path..gitignoreignorestests/fixtures/design-system/flake-selection-*/.vitest.config.tsexcludes that pattern unlessBUZZ_FLAKE_CHECK_FIXTUREis set, and keeps Vitest's default excludes. The test sets the variable for the Vitest processes it starts, and clears it int.after.tsconfig.design.jsonexcludes the pattern.biome.jsonforce-ignores it with!!infiles.includes.design:check, check-icons and the pre-push hook's guards pass with a leftover present.design:testincludes only*.test.ts, and the fixture is.test.tsx.node --test tests/integration/flake-check.test.mjspasses all 10 tests, so the opt-in reachesvitest list. The run left nothing intests/fixtures/design-system/or /tmp.cases.test.tsxand aresult.jsonwere placed intests/fixtures/design-system/flake-selection-probe/. Before the third commit,design:typecheckfailed with two TS6133 errors.biome check --error-on-warnings .failed with 2 errors and 2 warnings, all in the probe. After it, both pass, and so doesbiome lint --error-on-warnings ..tsc -p tsconfig.design.json --listFilesOnlylists all 53 fixture files outside the probe and none inside it.The third commit also corrects the spool
TempDircomment inrelay/tests.rs. It had said the dir is removed after the app drops. Tauri does not promise to drop managed state with theApp, so theSpoolsmay outlive the dir. The comment now says only that the probe owns the dir and removes it when the probe returns or panics.Overlaps
#1115 edits
vitest.config.ts, and draft #1286 editsbiome.json. Both conflict with this PR in those files, and both already conflict withmainelsewhere.Verification scope
Only the commands listed above ran, on local macOS, on the source branch. The three commits were cherry-picked onto current
mainwith no conflicts and unchanged patches. Git hooks were skipped for the push.Remaining gaps
tests.rschange is comment-only and was not compiled or run.🤖 Generated with Claude Code