From cfdc81e1feaf0fbc0bf6d0882b42f62eca92fd96 Mon Sep 17 00:00:00 2001 From: Charis <26616127+charislam@users.noreply.github.com> Date: Wed, 14 Oct 2026 14:30:41 -0400 Subject: [PATCH] test(studio): raise timeout for NewScopedTokenSheet tests (#51755) ## Summary - The `NewScopedTokenSheet` tests were flaky on master. The 5s default timeout was hit intermittently, most visibly in the "falls back to Custom when a row diverges from the preset" test, plus some sibling tests. - Observed in unit-test runs on master. Reproduced locally by running the file under heavy CPU load, where tests took 4.5-5s versus ~1s on an idle machine. - Fix: file-level `vi.setConfig({ testTimeout: 15_000 })`. This only affects this file because vitest isolates test files. ## Testing - Ran the file 5 times under the same CPU load. All 21 tests passed each time. --- .../Account/AccessTokens/Scoped/NewScopedTokenSheet.test.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/studio/components/interfaces/Account/AccessTokens/Scoped/NewScopedTokenSheet.test.tsx b/apps/studio/components/interfaces/Account/AccessTokens/Scoped/NewScopedTokenSheet.test.tsx index cc15bd2c105..5bb532e7add 100644 --- a/apps/studio/components/interfaces/Account/AccessTokens/Scoped/NewScopedTokenSheet.test.tsx +++ b/apps/studio/components/interfaces/Account/AccessTokens/Scoped/NewScopedTokenSheet.test.tsx @@ -25,6 +25,10 @@ vi.mock('common', async (importOriginal) => { const { mockTrack } = vi.hoisted(() => ({ mockTrack: vi.fn() })) vi.mock('@/lib/telemetry/track', () => ({ useTrack: () => mockTrack })) +// Each test mounts the full sheet and walks several async steps. That takes ~1s on an idle +// machine but approaches the default 5s limit when CI workers are saturated. +vi.setConfig({ testTimeout: 15_000 }) + const user = userEvent.setup({ writeToClipboard: true, })