Skip to content

fix(playwright): reload to trigger concurrent 401s in SSO renewal test - #28322

Merged
siddhant1 merged 1 commit into
mainfrom
fix/sso-renewal-concurrent-401s-state-pollution
May 21, 2026
Merged

siddhant1 merged 1 commit into
mainfrom
fix/sso-renewal-concurrent-401s-state-pollution

Conversation

@siddhant1

Copy link
Copy Markdown
Contributor

Summary

The nightly SSO Login workflow was failing on the keycloak-azure-saml matrix entry because the test should queue concurrent 401s behind a single refresh call (SSORenewal.spec.ts:163) clicked app-bar-item-explore to 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 shared userPage to /explore. The click was a no-op (<NavLink> to the same route → no API calls fire), so page.waitForResponse for 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():

  • Fires many parallel authenticated API calls — a much closer match to what the test name claims to verify (concurrent 401s queued behind a single refresh).
  • Matches the pattern already used by the next test in the same file (line 201).
  • Unblocks the third renewal test that was being skip-cascaded.

Failing run for reference: https://github.com/open-metadata/OpenMetadata/actions/runs/26205433077

Test plan

  • keycloak-azure-saml matrix entry of SSO Login Nightly workflow goes green (run via workflow_dispatch with sso_provider=keycloak-azure-saml).
  • HTML report artifact sso-login-html-report-keycloak-azure-saml shows 9 passed, 0 failed, 0 did not run.
  • Okta matrix entry remains green (the renewal describe is intentionally skipped on Okta and stays that way).
  • Local run against the bundled Keycloak SAML fixture passes:
    docker compose -f docker/local-sso/keycloak-saml/docker-compose.yml up -d
    cd openmetadata-ui/src/main/resources/ui
    SSO_PROVIDER_TYPE=keycloak-azure-saml \
      [email protected] \
      SSO_PASSWORD=OpenMetadata@123 \
      KEYCLOAK_SAML_BASE_URL=http://localhost:8080 \
      PLAYWRIGHT_IS_OSS=true \
      npx playwright test --project=sso-auth --workers=1 playwright/e2e/Auth/SSORenewal.spec.ts

🤖 Generated with Claude Code

@siddhant1
siddhant1 requested a review from a team as a code owner May 21, 2026 06:04
Copilot AI review requested due to automatic review settings May 21, 2026 06:04
@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@siddhant1 siddhant1 added UI UI specific issues safe to test Add this label to run secure Github workflows on PRs labels May 21, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@github-actions

github-actions Bot commented May 21, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 63%
63.43% (65595/103402) 44.24% (36023/81421) 46.95% (10575/22522)

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]>
@siddhant1
siddhant1 force-pushed the fix/sso-renewal-concurrent-401s-state-pollution branch from 5941dc4 to 6139d58 Compare May 21, 2026 07:16
@gitar-bot

gitar-bot Bot commented May 21, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved

Replaces 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.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@siddhant1
siddhant1 enabled auto-merge (squash) May 21, 2026 08:17
@siddhant1 siddhant1 added the To release Will cherry-pick this PR into the release branch label May 21, 2026
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

🟡 Playwright Results — all passed (7 flaky)

✅ 4147 passed · ❌ 0 failed · 🟡 7 flaky · ⏭️ 89 skipped

Shard Passed Failed Flaky Skipped
✅ Shard 1 299 0 0 4
🟡 Shard 2 775 0 2 11
🟡 Shard 3 779 0 2 7
🟡 Shard 4 784 0 1 12
🟡 Shard 5 772 0 1 47
🟡 Shard 6 738 0 1 8
🟡 7 flaky test(s) (passed on retry)
  • Features/DataQuality/BundleSuiteBulkOperations.spec.ts › Add test case to existing Bundle Suite (shard 2, 1 retry)
  • Features/KnowledgeCenter.spec.ts › Article mentions in description should working for Knowledge Center (shard 2, 1 retry)
  • Features/RTL.spec.ts › Verify Following widget functionality (shard 3, 1 retry)
  • Features/Table.spec.ts › Table pagination with sorting should works (shard 3, 1 retry)
  • Pages/Domains.spec.ts › Create DataProducts and add remove assets (shard 4, 1 retry)
  • Pages/ExplorePageRightPanel_KnowledgeCenter.spec.ts › Should remove user owner for knowledgeCenter (shard 5, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@siddhant1
siddhant1 merged commit 533813d into main May 21, 2026
83 of 90 checks passed
@siddhant1
siddhant1 deleted the fix/sso-renewal-concurrent-401s-state-pollution branch May 21, 2026 10:55
@github-actions

Copy link
Copy Markdown
Contributor

Changes have been cherry-picked to the 1.12.9 branch.

github-actions Bot pushed a commit that referenced this pull request May 21, 2026
…#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)
@github-actions

Copy link
Copy Markdown
Contributor

Changes have been cherry-picked to the 1.13 branch.

github-actions Bot pushed a commit that referenced this pull request May 21, 2026
…#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)

This branch was previously deployed

1 inactive deployment
test — 6139d580 Deployed May 21, 2026 by siddhant1 via playwright-ci-postgresql (5, 6) #47973
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs To release Will cherry-pick this PR into the release branch UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants