[quarantine] worklog-timer.spec.ts — timing-dependent tests with fixed sleeps #53

Closed
opened 2026-08-05 02:26:58 +00:00 by Mark · 1 comment
Owner

Quarantined under Mark/nodedesk#49 (Phase 2 quality gates).

Test location

  • File: tests/worklog-timer.spec.ts
  • Lines: 13, 18, 62 (page.waitForTimeout calls and races)
  • Tests affected: all 3 tests in file

Reproduction

npm run test:e2e:all -- tests/worklog-timer.spec.ts

Note: Flaky on slow runners, may timeout or race timer render.

Failure mode

  • Line 18: page.waitForTimeout(1100) — assumes timer increments within 1100ms.
  • Line 62: page.waitForTimeout(500) — assumes timer starts within 500ms after reload.
  • Line 13: expect(page.getByText("00:00")).toBeVisible() — races timer's first render.

Root cause

Fixed sleeps are the canonical Playwright anti-pattern. Wall-clock dependency causes flakes on slow runners or under load. The timer is a client-side React component; its render/update timing is non-deterministic.

Acceptance criteria for un-quarantine

  • Replace waitForTimeout(1100) with expect(locator).toBeVisible({ timeout: 2000 }) polling on the timer display.
  • Replace waitForTimeout(500) with explicit wait for "Stop" button after reload.
  • Add guard for "00:00" visibility with timeout.

References

  • Parent: #49 (quarantine tracking)
  • Epic: #38 (quality gates)
  • Audit: docs/ci/audit.md §3.3
Quarantined under Mark/nodedesk#49 (Phase 2 quality gates). ## Test location - File: `tests/worklog-timer.spec.ts` - Lines: 13, 18, 62 (`page.waitForTimeout` calls and races) - Tests affected: all 3 tests in file ## Reproduction ```bash npm run test:e2e:all -- tests/worklog-timer.spec.ts ``` Note: Flaky on slow runners, may timeout or race timer render. ## Failure mode - Line 18: `page.waitForTimeout(1100)` — assumes timer increments within 1100ms. - Line 62: `page.waitForTimeout(500)` — assumes timer starts within 500ms after reload. - Line 13: `expect(page.getByText("00:00")).toBeVisible()` — races timer's first render. ## Root cause Fixed sleeps are the canonical Playwright anti-pattern. Wall-clock dependency causes flakes on slow runners or under load. The timer is a client-side React component; its render/update timing is non-deterministic. ## Acceptance criteria for un-quarantine - [ ] Replace `waitForTimeout(1100)` with `expect(locator).toBeVisible({ timeout: 2000 })` polling on the timer display. - [ ] Replace `waitForTimeout(500)` with explicit wait for "Stop" button after reload. - [ ] Add guard for "00:00" visibility with timeout. ## References - Parent: #49 (quarantine tracking) - Epic: #38 (quality gates) - Audit: `docs/ci/audit.md` §3.3
Author
Owner

Quarantined all 3 tests in tests/worklog-timer.spec.ts under @quarantine tag.

Changes:

  • Added { tag: "@quarantine" } to each test
  • Added comment block explaining the timing-dependent issues
  • Tests now excluded from default npm test run via --grep-invert @quarantine
  • Tests run separately via npm run test:e2e:quarantine

Root cause: Fixed sleeps (waitForTimeout(1100), waitForTimeout(500)) are the canonical Playwright anti-pattern. Wall-clock dependency causes flakes on slow runners or under load.

Un-quarantine criteria (from #53):

  • Replace waitForTimeout(1100) with expect(locator).toBeVisible({ timeout: 2000 }) polling
  • Replace waitForTimeout(500) with explicit wait for "Stop" button after reload
  • Add guard for "00:00" visibility with timeout

Commit: b299743 on ci/quality-gates-matrix (PR #45)

Quarantined all 3 tests in `tests/worklog-timer.spec.ts` under `@quarantine` tag. **Changes:** - Added `{ tag: "@quarantine" }` to each test - Added comment block explaining the timing-dependent issues - Tests now excluded from default `npm test` run via `--grep-invert @quarantine` - Tests run separately via `npm run test:e2e:quarantine` **Root cause:** Fixed sleeps (`waitForTimeout(1100)`, `waitForTimeout(500)`) are the canonical Playwright anti-pattern. Wall-clock dependency causes flakes on slow runners or under load. **Un-quarantine criteria (from #53):** - Replace `waitForTimeout(1100)` with `expect(locator).toBeVisible({ timeout: 2000 })` polling - Replace `waitForTimeout(500)` with explicit wait for "Stop" button after reload - Add guard for "00:00" visibility with timeout Commit: `b299743` on `ci/quality-gates-matrix` (PR #45)
Mark 2026-08-05 05:05:05 +00:00
Sign in to join this conversation.
No description provided.