Skip to content

Conversation

siverne
Copy link
Member

@siverne siverne commented Nov 24, 2026

Closes #103

What

Loads the lazy pages once in a beforeAll with a 30 s timeout, before the route tests run.

Why

The first test that opened a lazy page waited for Vitest to build the page's code. When the whole suite runs at once, that could take longer than Vitest's default test timeout of 5000 ms, so the test timed out now and then (seen in the review of #102).

How to test

Run npm run test:coverage in frontend a few times. Passed 3 of 3 runs locally.

AI

Claude helped find the cause (the findBy timeout was the same as the test timeout) and suggested the fix. I wrote the change myself and ran the tests comparing the old and the new.

@siverne siverne requested a review from a team as a code owner November 24, 2026 11:33
Copy link
Member

@oscarba oscarba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good impl of before all tests :)

@oscarba oscarba merged commit 520af23 into main Nov 24, 2026
@oscarba oscarba deleted the 103-flaky-app-test branch November 24, 2026 11:40
@williasc williasc mentioned this pull request Nov 25, 2026
3 tasks
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flaky test: App.test.tsx times out when the whole suite runs
2 participants