Skip to content

Integration test passes only when its siblings run first #104

Description

@ualtinok

Found while gating PR #92. Not a production defect and not a regression — it reproduces on main at 9bf8f4c.

What happens

bun test src/tests/integration.test.ts -t "file-exhausted fallback with an empty process quota cache"
(fail) ... [554ms]

The same test passes when the whole file runs, and passes in the full suite (1064/0). So it depends on state a sibling test establishes first — most likely shared on-disk sidebar/account state or a module-level cache that an earlier test seeds.

Why it is worth fixing

A test that only passes with its siblings cannot gate the behaviour it names. Two concrete costs:

  • Anyone bisecting or iterating with -t on this test gets a failure that has nothing to do with their change, which is exactly when a red test is most misleading.
  • If the sibling that seeds the state is ever reordered, renamed, or deleted, this test starts failing for a reason unrelated to the code it covers — or worse, keeps passing while covering nothing.

This repository already mutation-tests production hunks because it has shipped tests that looked like coverage and gated nothing. An order-dependent test is the same family: it looks like coverage from the suite summary.

Suggested direction

Give the test its own setup rather than inheriting one — seed the sidebar/account state it needs inside the test or a beforeEach, so it holds under -t in isolation. Worth a scan for siblings in the same file with the same dependency.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions