Skip to content

flaky: admin product list CLI suite times out on process-spawn variance #368

Description

@zachdunn

The admin product list — org optional (#259) suite (tests/cli/product-list-all-orgs.test.ts) intermittently red-flags CI with a per-test timeout (observed ~5.3s on the --help case) even though every assertion passes on rerun and locally. It flaked #366's CI and had to be re-run to merge.

Cause

Each it(...) shells out via runCli([...]) (tests/utils.ts), spawning a fresh Node/Bun process that loads the whole commander tree. Five spawns in one file, under a loaded CI runner, occasionally push a single spawn past bun's default per-test timeout. The tests are correct — it's process-startup variance, not logic.

Options (pick one)

  1. Raise the timeout for this suite: it("…", () => {…}, 15_000) (or a describe-level default) — smallest change, removes the false red.
  2. Collapse the five runCli spawns into fewer processes where the assertions allow (e.g. one --help spawn asserted against multiple substrings is already single-spawn; the three validation cases each need their own argv, so this only partially helps).
  3. Warm/one-shot the CLI in-process instead of spawning, if runCli can expose an in-process entry (larger change; check whether other suites depend on the subprocess boundary for env isolation).

Recommend option 1 — a generous per-test timeout on the subprocess-spawning CLI suites is the pragmatic fix; the assertions themselves are fast and deterministic once the process is up.

Context: surfaced while landing the stub org get work (#366); CI is the merge gate (no pre-push test hook by design), so a flaky suite directly costs rerun cycles.

Activity

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions