Skip to content

fix: flush the SCIM revoke Popconfirm in act() to stop CI timeouts - #722

Merged
babltiga merged 1 commit into
mainfrom
fix/AF-scim-revoke-test-timeout
Aug 15, 2026
Merged

fix: flush the SCIM revoke Popconfirm in act() to stop CI timeouts#722
babltiga merged 1 commit into
mainfrom
fix/AF-scim-revoke-test-timeout

Conversation

@babltiga

Copy link
Copy Markdown
Contributor

main went red on run 31801298636 (merge of #721). Every area job passed except Frontend, where exactly one test blew the 15s budget:

FAIL src/pages/admin/ScimConfigPage.test.tsx > ScimConfigPage > revokes a token after confirmation
Error: Test timed out in 15000ms.
Test Files 1 failed | 190 passed   Tests 1 failed | 1479 passed

Not a product bug — a slow test that ran out of headroom on a slower runner. It was already the second-slowest test in the suite: 8 275 ms on #721's green run, and the whole main run was ~1.8x slower than that one.

Why it was slow

await screen.findByRole('button', { name: 'Revoke' }) polled a whole-document RTL role scan while AntD's Popconfirm portal mounted and animated, so the cost was (number of scans during motion) x (scan cost, proportional to DOM size) — and ScimConfigPage is a full page (form + 3 Selects + token table + 2 modals). The same shape is cheap on a small component (ApiKeysSection revoke = 0.51 s); the expense of role queries over a rendered AntD table under jsdom is already documented at RolesPage.test.tsx:115.

Fix

Open the Popconfirm inside act() — the pattern already used for AntD portal confirms in QueryDetailPage.test.tsx:328-350 — so the OK button exists on the first scan, and look the trigger up by aria-label instead of computing accessible names for every button. The assertion (revokeScimToken('tok-1') only fires after confirming) is unchanged.

Local: 4.44 s → 0.31 s, in line with the file's other five tests (0.01–0.31 s). Full suite green: 1480 passed, plus lint / typecheck / build.

No global testTimeout bump and no vitest retry: the next-slowest test still has 2x headroom, and both would only delay detection of the next real problem.

The revoke test polled findByRole across the whole ScimConfigPage while the
Popconfirm portal mounted, re-running an expensive role scan on every motion
mutation: 8.3s on CI and >15s on a slow runner, which failed main. Open the
popup inside act() and look the trigger up by aria-label instead.

Local: 4.44s -> 0.31s.
@github-actions

Copy link
Copy Markdown
Contributor

Frontend Test Results

1 480 tests  ±0   1 480 ✅ +1   5m 48s ⏱️ +14s
  191 suites ±0       0 💤 ±0 
    1 files   ±0       0 ❌  - 1 

Results for commit b38d7ba. ± Comparison against base commit fe827a7.

@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report for Frontend Coverage (frontend)

Status Category Percentage Covered / Total
🟢 Lines 94.15% (🎯 90%) 2225 / 2363
🟢 Statements 92.27% (🎯 90%) 2473 / 2680
🟢 Functions 91.35% (🎯 90%) 676 / 740
🟢 Branches 84.37% (🎯 80%) 1393 / 1651
File CoverageNo changed files found.
Generated in workflow #950 for commit b38d7ba by the Vitest Coverage Report Action

@babltiga
babltiga merged commit ab5970d into main Aug 15, 2026
14 checks passed
@babltiga
babltiga deleted the fix/AF-scim-revoke-test-timeout branch August 15, 2026 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant