Why
Several tests use custom waitFor polling loops or real filesystem rotation with retry sleeps. Critique flagged flake risk in CI (especially Windows runners). Hardening now prevents intermittent red builds as the suite grows post–PR #48.
Hot spots
| File |
Pattern |
Lines |
shadow-agent/tests/capture/capture-transports.test.ts |
Custom waitFor (4s timeout) |
L22+, L157–278 |
shadow-agent/tests/capture/session-manager.test.ts |
Duplicate waitFor helper |
L28+, L92+ |
shadow-agent/tests/electron/start-main-process-privacy.test.ts |
vi.waitFor |
~L102 |
shadow-agent/tests/logger.test.ts |
File rotation poll loop |
L204–240 |
Acceptance criteria
References
docs/plans/plan-testing-observability.md — determinism first
- PR #48
Why
Several tests use custom
waitForpolling loops or real filesystem rotation with retry sleeps. Critique flagged flake risk in CI (especially Windows runners). Hardening now prevents intermittent red builds as the suite grows post–PR #48.Hot spots
shadow-agent/tests/capture/capture-transports.test.tswaitFor(4s timeout)shadow-agent/tests/capture/session-manager.test.tswaitForhelpershadow-agent/tests/electron/start-main-process-privacy.test.tsvi.waitForshadow-agent/tests/logger.test.tsAcceptance criteria
waitFortotests/helpers/with fake-clock or event-based resolution where possible.vi.advanceTimersByTimewhere applicable.@flakywith ticket if unavoidable).main(or document exceptions).References
docs/plans/plan-testing-observability.md— determinism first