Skip to content

TUI coverage gate flakes on Windows: App.test.tsx OAuth step-up tests fail under v8 instrumentation only #1942

Description

@olaservo

Version: v2 (main, reproduced at 07a2b4b)
Affected client: clients/tui (test infrastructure; Windows only)

Symptom

On Windows 11, npm run test:coverage in clients/tui fails with exactly one test failing per run — but a different one each time, always in App.test.tsx > App (OAuth result branches):

  • run 1: shows insufficient-scope message when step-up OAuth stays insufficient
  • run 2: completes a standard step-up authorize when OAuth succeeds
  • run 3 (clean upstream tree): same as run 2

npx vitest run __tests__/App.test.tsx without coverage passes 80/80 every time. The failures only appear under v8 instrumentation, which slows the Ink render loop enough for these waitFor-style OAuth-branch assertions to race.

What's known

  • Pre-exists unrelated work: reproduced identically on the upstream tip with no local changes.
  • Linux CI is green, so it's Windows-manifested (slower instrumented renders under the runner here).
  • 3/3 instrumented runs failed; 0 failures uninstrumented.

Impact

coverage:tui → root coveragenpm run ci fails on Windows even on a clean tree. Together with #1939 (verify scripts can't spawn npx) and #1941 (CLI worker teardown crash), the mandatory pre-push gate currently cannot pass on a Windows machine.

Context

Found while validating the fix for #1852 on a Windows machine.

Metadata

Metadata

Assignees

Labels

v2Issues and PRs for v2

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions