Skip to content

Commit ab2c31f

Browse files
committed
test(web): give the auth-redirect suite a budget that fits its work
Each case in client.authRedirect.test.ts calls vi.resetModules() and then re-imports client.ts, so the file re-evaluates a 6.5k-line module six times. That exceeds vitest's 5s default once the suite runs workers in parallel, which failed the run non-deterministically depending on machine load. Testing: `npm test` in web/ four consecutive times, 400/400 each.
1 parent 9d61ef0 commit ab2c31f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

web/src/api/client.authRedirect.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ beforeEach(() => {
7474
vi.restoreAllMocks()
7575
})
7676

77+
// resetModules per case re-evaluates client.ts in full, so six of those exceed
78+
// vitest's 5s default once workers run in parallel.
7779
describe('apiFetch OIDC 401 -> login redirect (single-flight)', () => {
7880
it('navigates to /auth/login exactly once for a burst of concurrent 401s', async () => {
7981
const rec = installDom('/traffic')
@@ -191,4 +193,4 @@ describe('apiFetch OIDC 401 -> login redirect (single-flight)', () => {
191193
expect(rec.urls).toEqual(['[reload]'])
192194
expect(rec.urls).not.toContain('/auth/login')
193195
})
194-
})
196+
}, 30_000)

0 commit comments

Comments
 (0)