Skip to content

fix(test): prevent flaky OktaSessionRenewalPublic second test - #31830

Merged
Rohit0301 merged 4 commits into
mainfrom
sso-okta-silent-renewal-flaky
Aug 21, 2026
Merged

fix(test): prevent flaky OktaSessionRenewalPublic second test#31830
Rohit0301 merged 4 commits into
mainfrom
sso-okta-silent-renewal-flaky

Conversation

@Rohit0301

@Rohit0301 Rohit0301 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Describe your changes:

The should fall back to interactive login when silent renewal returns login_required test was intermittently timing out in the Okta SSO suite. The suite runs in serial mode: test 1 ends by clicking app-bar-item-explore, leaving the browser on the Explore page. Test 2 then clicks the same sidebar item — but since React Router short-circuits same-path navigation, no API call fires, no 401 is received, and the renewal flow never triggers. The 60 s poll for interactive-authorize events times out with 0 hits.

The fix calls redirectToHomePage at the start of test 2 so the subsequent Explore click is always a real navigation.

Type of change:

  • Bug fix

High-level design:

N/A — small change.

Tests:

Use cases covered

  • Okta public-client silent-renewal fallback reliably triggers interactive-authorize when silent renewal returns login_required

Unit tests

  • Not applicable (Playwright test fix only).

Backend integration tests

  • Not applicable (no backend changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Fixed existing spec: playwright/e2e/Auth/OktaSessionRenewalPublic.spec.ts

Manual testing performed

  1. Reviewed CI runs on 2.0 and main — identical code, failure only on runs where test 1 left browser on Explore page.
  2. Root cause confirmed via test flow analysis: same-path React Router click = no navigation = no renewal.

UI screen recording / screenshots:

Not applicable.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.
  • For UI changes: I attached a screen recording and/or screenshots above.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.

Greptile Summary

The PR stabilizes the second Okta public-session-renewal test by returning to the home page before navigating to Explore, ensuring the navigation triggers the renewal flow.

  • Adds an explicit home-page reset before token expiration and Explore navigation.
  • Retains Playwright traces when an SSO test fails.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
openmetadata-ui/src/main/resources/ui/playwright/e2e/Auth/OktaSessionRenewalPublic.spec.ts Resets the shared serial-test page to /my-data before installing renewal mocks, expiring the token, and navigating to Explore.
openmetadata-ui/src/main/resources/ui/playwright.config.ts Configures the serial SSO Playwright project to retain traces only for failed tests.

Reviews (4): Last reviewed commit: "fix(test): use retain-on-failure trace f..." | Re-trigger Greptile

…ing home first

Test 1 ends on the Explore page; clicking app-bar-item-explore in test 2
was a no-op same-path navigation, so no API call / 401 / renewal was
triggered and the interactive-authorize poll timed out. Navigating home
before the click ensures a real navigation always fires.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@github-actions github-actions Bot added the UI UI specific issues label Aug 20, 2026
@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!

@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 3a2443af9237ef9ce13a85729842ed852c7b3e35 in Playwright run 32374964901, attempt 1.

✅ 551 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky

Performance

Blocking targets: ✅ met · Optimization targets: 🟡 in progress

Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting.

🕒 Full workflow signal wall (to summary) 57m 16s

⏱️ Max setup 6m 11s · max shard execution 15m 26s · max shard-job elapsed before upload 23m 2s · reporting 4s

🌐 214.56 requests/attempt · 2.83 app boots/UI scenario · 22.79% common-shard skew

Optimization targets still in progress:

  • Common shard skew was 22.79% (convergence target: at most 15%).
  • Browser traffic was 214.56 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.83 per UI scenario (1618 boots / 572 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 103 0 0 0 0 0
✅ Shard chromium-02 103 0 0 0 0 0
✅ Shard chromium-03 91 0 0 0 0 0
✅ Shard chromium-04 102 0 0 0 0 0
✅ Shard data-asset-rules-01 61 0 0 0 0 0
✅ Shard domain-isolation-01 14 0 0 0 0 0
✅ Shard global-state-01 34 0 0 0 0 0
✅ Shard ingestion-01 1 0 0 0 0 0
✅ Shard reindex-01 2 0 0 0 0 0
✅ Shard search-01 11 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0

📦 Download artifacts

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

@Rohit0301 Rohit0301 self-assigned this Aug 20, 2026
@Rohit0301 Rohit0301 added the safe to test Add this label to run secure Github workflows on PRs label Aug 20, 2026
Overrides the global on-first-retry setting so traces are collected on
every SSO test run (pass or fail), making them available in the HTML
report artifact for easier debugging.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment thread openmetadata-ui/src/main/resources/ui/playwright.config.ts Outdated
chirag-madlani
chirag-madlani previously approved these changes Aug 20, 2026
…failure

Replaces 'on' with 'retain-on-failure' so traces are kept for the first
failing attempt rather than only on retry, without generating trace files
for passing tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@gitar-bot

gitar-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 1 resolved / 1 findings

Stabilizes the Okta session renewal Playwright test by ensuring a home-page redirect before the second test's Explore navigation, resolving the intermittent test timeout. No issues found.

✅ 1 resolved
Performance: trace: 'on' records traces for every sso-auth test run

📄 openmetadata-ui/src/main/resources/ui/playwright.config.ts:248
Setting trace: 'on' for the sso-auth project unconditionally records and writes a Playwright trace for every test on every run (not just failures), increasing CI artifact size and per-test overhead. Since the goal is diagnosing intermittent flakiness, prefer trace: 'retain-on-failure' (or 'on-first-retry') to capture traces only when needed, or gate the always-on setting behind an env var so it isn't permanently enabled in main.

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@Rohit0301
Rohit0301 enabled auto-merge August 20, 2026 13:36
@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-08-20T20:17:20Z)

Blocked the queue: playwright-summary

@Rohit0301
Rohit0301 added this pull request to the merge queue Aug 21, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-08-21T09:05:40Z)

Blocked the queue: playwright-summary

@Rohit0301
Rohit0301 added this pull request to the merge queue Aug 21, 2026
Merged via the queue into main with commit 22c80c1 Aug 21, 2026
98 of 100 checks passed
@Rohit0301
Rohit0301 deleted the sso-okta-silent-renewal-flaky branch August 21, 2026 10:22
@gitar-bot

gitar-bot Bot commented Aug 21, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 1 resolved / 1 findings

Stabilizes the Okta session renewal Playwright test by ensuring a home-page redirect before the second test's Explore navigation, resolving the intermittent test timeout. No issues found.

✅ 1 resolved
Performance: trace: 'on' records traces for every sso-auth test run

📄 openmetadata-ui/src/main/resources/ui/playwright.config.ts:248
Setting trace: 'on' for the sso-auth project unconditionally records and writes a Playwright trace for every test on every run (not just failures), increasing CI artifact size and per-test overhead. Since the goal is diagnosing intermittent flakiness, prefer trace: 'retain-on-failure' (or 'on-first-retry') to capture traces only when needed, or gate the always-on setting behind an env var so it isn't permanently enabled in main.

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

chirag-madlani pushed a commit that referenced this pull request Aug 21, 2026
* fix(test): prevent flaky Okta silent-renewal fallback test by navigating home first

Test 1 ends on the Explore page; clicking app-bar-item-explore in test 2
was a no-op same-path navigation, so no API call / 401 / renewal was
triggered and the interactive-authorize poll timed out. Navigating home
before the click ensures a real navigation always fires.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat(test): enable trace always for sso-auth Playwright project

Overrides the global on-first-retry setting so traces are collected on
every SSO test run (pass or fail), making them available in the HTML
report artifact for easier debugging.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(test): use retain-on-failure trace for sso-auth to capture first failure

Replaces 'on' with 'retain-on-failure' so traces are kept for the first
failing attempt rather than only on retry, without generating trace files
for passing tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
(cherry picked from commit 22c80c1)
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 UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants