Repository navigation
fix(playwright): reload to trigger concurrent 401s in SSO renewal test - #28322
Conversation
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
There was a problem hiding this comment.
Pull request overview
Fixes flakiness in the Playwright SSO renewal suite by ensuring the “concurrent 401s” test reliably triggers authenticated traffic even when the shared serial userPage is already on /explore.
Changes:
- Replace the no-op navigation click with
page.reload()in the “queue concurrent 401s” test to trigger parallel authenticated requests and a single refresh call.
Test #8 ("should queue concurrent 401s behind a single refresh call") was passing for the wrong reason. The click on app-bar-item-explore was a no-op (NavLink to the same route), but the document.body click listener in AppContainer.tsx was firing analytics.track on every click anywhere — that PUT to /api/v1/analytics/web/events/collect 401'd, was caught by the in-app axios interceptor, refreshed, and the test happened to see a 200 on /api/v1/auth/refresh. PR #28232 removed that global click listener (it was dead-ended analytics surface area). The hidden trigger is gone, so test #8 has no actual authenticated request to 401 — waitForResponse for /refresh times out. Fix: navigate the user away from /explore (back to /my-data) before the expiry wait, so the subsequent app-bar-item-explore click is a real route change that fires the page's API calls and 401s through the in-app refresh path the test name promises. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
5941dc4 to
6139d58
Compare
Code Review ✅ ApprovedReplaces a no-op click with a page reload in the SSO renewal test to reliably trigger concurrent 401s and resolve the test suite timeout. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
|
🟡 Playwright Results — all passed (7 flaky)✅ 4147 passed · ❌ 0 failed · 🟡 7 flaky · ⏭️ 89 skipped
🟡 7 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
|
Changes have been cherry-picked to the 1.12.9 branch. |
…#28322) Test #8 ("should queue concurrent 401s behind a single refresh call") was passing for the wrong reason. The click on app-bar-item-explore was a no-op (NavLink to the same route), but the document.body click listener in AppContainer.tsx was firing analytics.track on every click anywhere — that PUT to /api/v1/analytics/web/events/collect 401'd, was caught by the in-app axios interceptor, refreshed, and the test happened to see a 200 on /api/v1/auth/refresh. PR #28232 removed that global click listener (it was dead-ended analytics surface area). The hidden trigger is gone, so test #8 has no actual authenticated request to 401 — waitForResponse for /refresh times out. Fix: navigate the user away from /explore (back to /my-data) before the expiry wait, so the subsequent app-bar-item-explore click is a real route change that fires the page's API calls and 401s through the in-app refresh path the test name promises. Co-authored-by: Siddhant <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> (cherry picked from commit 533813d)
|
Changes have been cherry-picked to the 1.13 branch. |
…#28322) Test #8 ("should queue concurrent 401s behind a single refresh call") was passing for the wrong reason. The click on app-bar-item-explore was a no-op (NavLink to the same route), but the document.body click listener in AppContainer.tsx was firing analytics.track on every click anywhere — that PUT to /api/v1/analytics/web/events/collect 401'd, was caught by the in-app axios interceptor, refreshed, and the test happened to see a 200 on /api/v1/auth/refresh. PR #28232 removed that global click listener (it was dead-ended analytics surface area). The hidden trigger is gone, so test #8 has no actual authenticated request to 401 — waitForResponse for /refresh times out. Fix: navigate the user away from /explore (back to /my-data) before the expiry wait, so the subsequent app-bar-item-explore click is a real route change that fires the page's API calls and 401s through the in-app refresh path the test name promises. Co-authored-by: Siddhant <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> (cherry picked from commit 533813d)



Summary
The nightly SSO Login workflow was failing on the
keycloak-azure-samlmatrix entry because the testshould queue concurrent 401s behind a single refresh call(SSORenewal.spec.ts:163) clickedapp-bar-item-exploreto trigger an authenticated request — but the previous test in the same serial describe (should silently refresh the access token after expiry) had already navigated the shareduserPageto/explore. The click was a no-op (<NavLink>to the same route → no API calls fire), sopage.waitForResponsefor the refresh endpoint timed out after 15s.Because the describe runs in serial mode, the next test (
should force re-login when the SAML session is gone) was then auto-skipped by Playwright (1 did not run).Switching the trigger to
page.reload():Failing run for reference: https://github.com/open-metadata/OpenMetadata/actions/runs/26205433077
Test plan
keycloak-azure-samlmatrix entry ofSSO Login Nightlyworkflow goes green (run viaworkflow_dispatchwithsso_provider=keycloak-azure-saml).sso-login-html-report-keycloak-azure-samlshows9 passed, 0 failed, 0 did not run.🤖 Generated with Claude Code