Skip to content

Flaky CI: tests/cli/work.test.ts > 'clears handoff with --clear' (work handoff --clear exits 1 under CI load) #25

@vilosource

Description

@vilosource

Symptom

On CI (GitHub Actions, 2-core, under vitest cross-file parallelism),
tests/cli/work.test.ts > kb work CLI > handoff > clears handoff with --clear intermittently fails:

AssertionError: expected 1 to be +0   // expect(exitCode).toBe(0)

i.e. the kb work handoff --clear CLI subprocess exits 1 instead of 0.

Evidence it is a pre-existing, non-deterministic flake

Why it matters

It threatens every PR in the v2 privileged-write-channel chain (and the
repo generally) with red CI that requires a manual re-run.

Suggested fix direction

Harden tests/cli/work.test.ts against CI load: ensure the CLI
bundle/build is fresh before the subprocess runs, increase per-runKb
robustness (retry/await on the spawn), or isolate the heavy CLI-subprocess
E2E files from cross-file parallel contention (a vitest projects split
for process-spawning E2E — same class as artifact-isolation.test.ts).

Tracking-only; not blocking the v2 chain unless it reproduces
deterministically (per maintainer decision 2026-05-16).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions