Skip to content

pm-dispatch validate.test.ts: 'fixture cleanup' test deletes its fixture and asserts nothing #12670

Closed

Description

@dezren39

Finding

In pm-stack/dispatch/test/validate.test.ts, the fixture directory is removed inside a test that asserts nothing.

  • :438 creates base with mkdtempSync(join(tmpdir(), "dispatch-3999-")) inside describe("session directory symlink confinement (issue #3999)") (:429).

  • :516-518:

    test("fixture cleanup", () => {
      rmSync(base, { recursive: true, force: true });
      expect(true).toBe(true);
    });
  • The file has no afterAll or afterEach (grep -n afterAll returns nothing).

Why it matters

  • Order-dependent: the temp directory is removed only when this test runs. A filtered run (bun test -t <name>), a shard, or a -bail stop skips it and leaks a dispatch-3999-* directory in tmpdir.
  • No signal: expect(true).toBe(true) always passes, so the test reports a pass even if the removal failed.
  • Low severity, but it is the kind of test-quality drift the testing doctrine (doc/agents/testing-doctrine.md) asks us to avoid.

Suggested fix shape

Move the rmSync into an afterAll in that describe block and delete the fixture cleanup test. If the teardown must be checked, assert existsSync(base) === false in afterAll or in a dedicated test.

Activity

  1. added
    kind/testTest coverage, test infrastructure, or test-only fixes
    effort/xsTrivial: expected under 30 minutes of work
    on Nov 22, 2026
  2. developing-today commented on Nov 22, 2026

    @developing-today
    Contributor
  3. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Done-check — Lane KV (archer), 2026-11-23. This issue's premise no longer holds on current main; the fix landed before this pickup:

    • Commit 99008f9427 "pm-dispatch: tear down the symlink-confinement fixture in afterAll", merged via PR pm-dispatch: tear down the symlink-confinement fixture in afterAll #12676 at 2026-11-22T20:47:28Z (~25 minutes after this issue was filed).
    • Verified first-hand on current main: pm-stack/dispatch/test/validate.test.ts imports afterAll (line 1) and the session directory symlink confinement (issue #3999) describe block tears the fixture down in afterAll (line 444: rmSync(base, { recursive: true, force: true })).
    • The fixture cleanup test that asserted nothing is gone — grep "fixture cleanup" over the file on main returns no match.

    Closing as completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/xsTrivial: expected under 30 minutes of workkind/testTest coverage, test infrastructure, or test-only fixesstatus:done

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions