Skip to content

Audit and stabilize flaky tests across the stack #4503

Description

@DeboraSerra

Review the existing frontend and backend test suites for real timers, unawaited promises, missing waitFor, non-deterministic data, and tests asserting on console.log. Fix the worst offenders first, focusing on async hook tests, dashboard metric tests, and integration tests that rely on fixed dates. Replace setTimeout in tests with vi.advanceTimersByTimeAsync or jest.advanceTimersByTimeAsync where appropriate.

On the backend, look for tests that assert on log output or depend on the order of database rows without an explicit ORDER BY. Stabilize them and add a CI check that runs the test suite three times in a row without retries to prove flakiness is gone.

Acceptance: Test suite passes three consecutive local/CI runs without retries; no test uses real network/time; flaky-test tracker documents root causes and fixes.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions