镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

test: stop tests leaving temp dirs and a flake-check fixture behind - #1977

Merged
matt2e merged 3 commits into
mainfrom
test-git-cleanup-leftovers
Oct 31, 2026
Merged

matt2e merged 3 commits into
mainfrom
test-git-cleanup-leftovers

Conversation

@matt2e

@matt2e matt2e commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Three tests left files behind. Two left temp dirs on every run, and 224 buzz-spool-ipc-* and 48 preview-* 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 later vitest run, pnpm check and lint in that worktree. No product code changes.

Temp dirs left on every run (first commit)

  • Rust: isolated_agent_ipc_probe (src-tauri/src/relay/tests.rs) rooted its Spools at a new temp_dir()/buzz-spool-ipc-<uuid> dir that nothing removed. The parent test runs the probe twice on Unix, so each cargo test of src-tauri left two dirs. The root is now a TempDir that the probe owns, and it is removed when the probe returns or panics.
  • Node: the three fixture tests in tests/integration/preview-feed.test.mjs never removed their mkdtempSync dirs, so each node --test tests/integration left three in /tmp. Each test now registers t.after cleanup, as prune-preview-releases.test.mjs does.
  • Verified: 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.

A leftover flake-selection-* fixture broke later runs (second and third commits)

  • Cause: the parameterized-selection test in flake-check.test.mjs writes a flake-selection-* suite into tests/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:
    • Vitest's include matched it.
    • tsconfig.design.json includes tests/fixtures/design-system. Its noUnusedLocals failed with TS6133 in design:typecheck and in the pre-push design hook.
    • biome.json has vcs.enabled: false, so biome check . and pnpm lint ignore .gitignore. They reported errors in the fixture.
  • Why the fixture stays in the repo: the test calls the script's real listVitest, which runs vitest list from the repo root with vitest.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 plain exclude does not work either, because Vitest also drops an excluded file that is named by exact path.
  • Change:
    • .gitignore ignores tests/fixtures/design-system/flake-selection-*/.
    • vitest.config.ts excludes that pattern unless BUZZ_FLAKE_CHECK_FIXTURE is set, and keeps Vitest's default excludes. The test sets the variable for the Vitest processes it starts, and clears it in t.after.
    • tsconfig.design.json excludes the pattern.
    • biome.json force-ignores it with !! in files.includes.
    • No other repo-wide check needs the pattern. design:check, check-icons and the pre-push hook's guards pass with a leftover present. design:test includes only *.test.ts, and the fixture is .test.tsx.
  • Verified:
    • node --test tests/integration/flake-check.test.mjs passes all 10 tests, so the opt-in reaches vitest list. The run left nothing in tests/fixtures/design-system/ or /tmp.
    • A probe copy of the fixture's cases.test.tsx and a result.json were placed in tests/fixtures/design-system/flake-selection-probe/. Before the third commit, design:typecheck failed 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 does biome lint --error-on-warnings .. tsc -p tsconfig.design.json --listFilesOnly lists all 53 fixture files outside the probe and none inside it.
    • A probe config with the same exclude pattern listed no tests for a fixture named by exact path. Without the opt-in, the test would therefore list nothing and fail its six-location assertion. That case was not run.

The third commit also corrects the spool TempDir comment in relay/tests.rs. It had 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 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 edits biome.json. Both conflict with this PR in those files, and both already conflict with main elsewhere.

Verification scope

Only the commands listed above ran, on local macOS, on the source branch. The three commits were cherry-picked onto current main with no conflicts and unchanged patches. Git hooks were skipped for the push.

Remaining gaps

  • The third commit's tests.rs change is comment-only and was not compiled or run.
  • Hosted CI has not run yet. It is the first full run on this head.

🤖 Generated with Claude Code

matt2e and others added 3 commits October 30, 2026 23:36
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>
@matt2e
matt2e requested a review from a team as a code owner October 30, 2026 12:39

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

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 wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 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.

@matt2e
matt2e merged commit 0da1254 into main Oct 31, 2026
36 checks passed
@matt2e
matt2e deleted the test-git-cleanup-leftovers branch October 31, 2026 00:48
shellz-n-stuff added a commit that referenced this pull request Oct 31, 2026
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>
morgmart added a commit that referenced this pull request Oct 31, 2026
…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
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.

3 participants