Skip to content

OCPBUGS-71237: fix session-persistence tests failing due to pre-loaded storageState - #17121

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
jhadvig:fix-session-persistence-e2e
Aug 31, 2026
Merged

openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
jhadvig:fix-session-persistence-e2e

Conversation

@jhadvig

@jhadvig jhadvig commented Aug 31, 2026 •

Copy link
Copy Markdown
Member

Analysis / Root cause:
The session-persistence.spec.ts tests have been failing 100% of the time in CI
(pull-ci-openshift-console-main-e2e-playwright — 86% overall failure rate, with these two tests contributing to every single failing run).

The root cause is that the console Playwright project injects storageState: adminStorageState into every browser context, pre-loading kubeadmin's OAuth cookies. When the session-persistence tests call performLogin(), the browser is already authenticated — page.goto(baseURL) lands on the dashboard instead of the OAuth login page, so the login element assertion ([data-test-id="login"] / #inputUsername) always times out after 30s with "element(s) not found".

Evidence:

  • auth-multiuser-login.spec.ts uses test.use({ storageState: { cookies: [], origins: [] } }) + performLogin() → 0% failure rate across 139 runs
  • session-persistence.spec.ts inherits storageState: adminStorageState + performLogin() → 100% failure rate
  • The only difference is the storageState configuration

Solution description:
Add test.use({ storageState: { cookies: [], origins: [] } }) to the describe block so each test starts with a clean, unauthenticated browser context. This matches the existing pattern in auth-multiuser-login.spec.ts.

The session-persistence tests need to control their own authentication lifecycle from scratch — they log in, delete/restart console pods, then verify the session survives. Pre-loading cookies from storageState defeats this by skipping the login page entirely.

Screenshots / screen recording:
N/A — no visual changes.

Test setup:
No additional setup required. The fix is to the test itself.

Test cases:

  • session survives console pod deletion — should now reach the OAuth login page, authenticate, delete pods, and verify session persistence
  • session survives console plugin toggle — should now reach the OAuth login page, authenticate, toggle a plugin, and verify session persistence

Browser conformance:

  • Chrome (Playwright CI uses Chromium)
  • Firefox
  • Safari (or Epiphany on Linux)

Additional info:
This is a one-line fix. The storageState override pattern is already established in the codebase at frontend/e2e/tests/console/app/auth-multiuser-login.spec.ts:8.

Made with Cursor

Summary by CodeRabbit

  • Tests
    • Improved session persistence test reliability by ensuring each test starts with a clean browser state.

…tate

The session-persistence tests call performLogin() to log in from scratch,
but the Playwright project config injects storageState (admin cookies) into
every browser context. This causes page.goto(baseURL) to land on the
dashboard instead of the OAuth login page, so the login element assertion
always times out.

Clear the storageState for this describe block so tests start with an
unauthenticated browser context, matching the pattern already used by
auth-multiuser-login.spec.ts.

Co-authored-by: Cursor <cursoragent@cursor.com>
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 31, 2026
@coderabbitai

coderabbitai Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 4217b779-8bed-44c3-bb21-e63373e3fa20

📥 Commits

Reviewing files that changed from the base of the PR and between 0c48df3 and 0cab36d.

📒 Files selected for processing (1)
  • frontend/e2e/tests/console/session-persistence.spec.ts

Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review.


Walkthrough

The session persistence test suite now starts each test with empty Playwright cookies and origins.

Changes

Session persistence test isolation

Layer / File(s) Summary
Reset browser storage per test
frontend/e2e/tests/console/session-persistence.spec.ts
Each test uses an empty Playwright storage state for cookies and origins.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 0cab3

This localized test-only change ensures session-persistence tests begin unauthenticated so they can exercise their intended login and session-survival flow; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the session-persistence test fix and identifies the pre-loaded storageState as the cause.
Description check ✅ Passed The description covers the root cause, solution, test setup, test cases, browser coverage, and additional implementation context. It is complete enough for review, although it does not list reviewers …
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed PASS: The pull request changes only Playwright setup by adding test.use({ storageState: { cookies: [], origins: [] } }); it does not add or modify a test title. The existing titles, `Session persist…
Test Structure And Quality ✅ Passed PASS: The custom check targets Ginkgo test code. This pull request changes only one TypeScript Playwright file, frontend/e2e/tests/console/session-persistence.spec.ts, by adding a Playwright `storag…
Microshift Test Compatibility ✅ Passed PASS — The PR changes only frontend/e2e/tests/console/session-persistence.spec.ts and adds one Playwright test.use(...) statement. The file uses Playwright test.describe and test(...), not Gin…
Single Node Openshift (Sno) Test Compatibility ✅ Passed PASS: The pull request changes only frontend/e2e/tests/console/session-persistence.spec.ts by adding a Playwright test.use storage-state override. The file uses Playwright test.describe/test, …
Topology-Aware Scheduling Compatibility ✅ Passed PASS — The pull request changes only frontend/e2e/tests/console/session-persistence.spec.ts. The one-line addition clears Playwright storageState; it does not modify deployment manifests, operator…
Ote Binary Stdout Contract ✅ Passed PASS. The pull request changes only frontend/e2e/tests/console/session-persistence.spec.ts and adds a Playwright test.use storage-state override. The changed file contains no stdout writes or OTE …
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PASS — The pull request adds one line to a TypeScript Playwright test. It does not add a Ginkgo test (It, Describe, Context, or When). The changed line only clears Playwright storageState. T…
No-Weak-Crypto ✅ Passed PASS. The pull request adds only test.use({ storageState: { cookies: [], origins: [] } }) to a Playwright test. The exact HEAD^..HEAD diff contains no MD5, SHA1, DES, RC4, 3DES, Blowfish, ECB, cus…
Container-Privileges ✅ Passed PASS. The pull request changes only frontend/e2e/tests/console/session-persistence.spec.ts and adds a Playwright storageState override. The diff introduces no privileged flag, host namespace setti…
No-Sensitive-Data-In-Logs ✅ Passed PASS: The only pull-request change adds a Playwright storageState override with empty cookies and origins. The changed file contains no logging statement, and the parent and current versions show no…
Full details: Description check

Explanation

The description covers the root cause, solution, test setup, test cases, browser coverage, and additional implementation context. It is complete enough for review, although it does not list reviewers or assignees.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.

Full details: Stable And Deterministic Test Names

Explanation

PASS: The pull request changes only Playwright setup by adding test.use({ storageState: { cookies: [], origins: [] } }); it does not add or modify a test title. The existing titles, Session persistence across pod restarts, session survives console pod deletion, and session survives console plugin toggle, are static and contain no generated names, timestamps, UUIDs, nodes, namespaces, IPs, or other run-dependent values. The file uses Playwright test() APIs, not Ginkgo title APIs.

Full details: Test Structure And Quality

Explanation

PASS: The custom check targets Ginkgo test code. This pull request changes only one TypeScript Playwright file, frontend/e2e/tests/console/session-persistence.spec.ts, by adding a Playwright storageState override. The changed file contains no Ginkgo constructs such as It, BeforeEach, AfterEach, Eventually, or Consistently, so the stated Ginkgo quality requirements are not applicable.

Full details: Microshift Test Compatibility

Explanation

PASS — The PR changes only frontend/e2e/tests/console/session-persistence.spec.ts and adds one Playwright test.use(...) statement. The file uses Playwright test.describe and test(...), not Ginkgo Describe(), It(), Context(), or When(). Therefore the MicroShift Ginkgo compatibility check does not apply. The diff adds no new API or resource references.

Full details: Single Node Openshift (Sno) Test Compatibility

Explanation

PASS: The pull request changes only frontend/e2e/tests/console/session-persistence.spec.ts by adding a Playwright test.use storage-state override. The file uses Playwright test.describe/test, not Ginkgo It, Describe, Context, or When, and the existing tests are unchanged. The SNO compatibility check is therefore not applicable, and the change introduces no multi-node or HA assumption.

Full details: Topology-Aware Scheduling Compatibility

Explanation

PASS — The pull request changes only frontend/e2e/tests/console/session-persistence.spec.ts. The one-line addition clears Playwright storageState; it does not modify deployment manifests, operator code, controllers, or scheduling configuration. No topology-related scheduling constraint is introduced.

Full details: Ote Binary Stdout Contract

Explanation

PASS. The pull request changes only frontend/e2e/tests/console/session-persistence.spec.ts and adds a Playwright test.use storage-state override. The changed file contains no stdout writes or OTE process-level setup such as main(), TestMain(), suite hooks, RunSpecs(), klog, or fmt.Print*. The OTE Binary Stdout Contract does not apply to this frontend test change.

Full details: Ipv6 And Disconnected Network Test Compatibility

Explanation

PASS — The pull request adds one line to a TypeScript Playwright test. It does not add a Ginkgo test (It, Describe, Context, or When). The changed line only clears Playwright storageState. The existing http://localhost:9000 fallback was unchanged, and the file contains no hardcoded IPv4 address or external connectivity requirement.

Full details: No-Weak-Crypto

Explanation

PASS. The pull request adds only test.use({ storageState: { cookies: [], origins: [] } }) to a Playwright test. The exact HEAD^..HEAD diff contains no MD5, SHA1, DES, RC4, 3DES, Blowfish, ECB, custom crypto implementation, or secret/token comparison. The same storage-state pattern already exists in auth-multiuser-login.spec.ts.

Full details: Container-Privileges

Explanation

PASS. The pull request changes only frontend/e2e/tests/console/session-persistence.spec.ts and adds a Playwright storageState override. The diff introduces no privileged flag, host namespace setting, SYS_ADMIN capability, root execution setting, or allowPrivilegeEscalation: true in a container or Kubernetes manifest.

Full details: No-Sensitive-Data-In-Logs

Explanation

PASS: The only pull-request change adds a Playwright storageState override with empty cookies and origins. The changed file contains no logging statement, and the parent and current versions show no new logging path. The override removes preloaded authentication state; it does not log passwords, tokens, keys, PII, session IDs, hostnames, or customer data.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@jhadvig

jhadvig commented Aug 31, 2026

Copy link
Copy Markdown
Member Author

/pipeline required

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-gcp-console
/test e2e-playwright

@logonoff

Copy link
Copy Markdown
Member

/retitle NO-JIRA: fix session-persistence tests failing due to pre-loaded storageState

@openshift-ci openshift-ci Bot changed the title e2e: fix session-persistence tests failing due to pre-loaded storageState NO-JIRA: fix session-persistence tests failing due to pre-loaded storageState Aug 31, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 31, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@jhadvig: This pull request explicitly references no jira issue.

Details

In response to this:

Analysis / Root cause:
The session-persistence.spec.ts tests have been failing 100% of the time in CI
(pull-ci-openshift-console-main-e2e-playwright — 86% overall failure rate, with these two tests contributing to every single failing run).

The root cause is that the console Playwright project injects storageState: adminStorageState into every browser context, pre-loading kubeadmin's OAuth cookies. When the session-persistence tests call performLogin(), the browser is already authenticated — page.goto(baseURL) lands on the dashboard instead of the OAuth login page, so the login element assertion ([data-test-id="login"] / #inputUsername) always times out after 30s with "element(s) not found".

Evidence:

  • auth-multiuser-login.spec.ts uses test.use({ storageState: { cookies: [], origins: [] } }) + performLogin() → 0% failure rate across 139 runs
  • session-persistence.spec.ts inherits storageState: adminStorageState + performLogin() → 100% failure rate
  • The only difference is the storageState configuration

Solution description:
Add test.use({ storageState: { cookies: [], origins: [] } }) to the describe block so each test starts with a clean, unauthenticated browser context. This matches the existing pattern in auth-multiuser-login.spec.ts.

The session-persistence tests need to control their own authentication lifecycle from scratch — they log in, delete/restart console pods, then verify the session survives. Pre-loading cookies from storageState defeats this by skipping the login page entirely.

Screenshots / screen recording:
N/A — no visual changes.

Test setup:
No additional setup required. The fix is to the test itself.

Test cases:

  • session survives console pod deletion — should now reach the OAuth login page, authenticate, delete pods, and verify session persistence
  • session survives console plugin toggle — should now reach the OAuth login page, authenticate, toggle a plugin, and verify session persistence

Browser conformance:

  • Chrome (Playwright CI uses Chromium)
  • Firefox
  • Safari (or Epiphany on Linux)

Additional info:
This is a one-line fix. The storageState override pattern is already established in the codebase at frontend/e2e/tests/console/app/auth-multiuser-login.spec.ts:8.

Made with Cursor

Summary by CodeRabbit

  • Tests
  • Improved session persistence test reliability by ensuring each test starts with a clean browser state.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@logonoff logonoff left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm
/label px-approved
/label docs-approved

@openshift-ci openshift-ci Bot added px-approved Signifies that Product Support has signed off on this PR docs-approved Signifies that Docs has signed off on this PR labels Aug 31, 2026
@logonoff

Copy link
Copy Markdown
Member

/verified by CI

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Aug 31, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@logonoff: This PR has been marked as verified by CI.

Details

In response to this:

/verified by CI

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Aug 31, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Tests from second stage were triggered manually. Pipeline can be controlled only manually, until HEAD changes. Use command to trigger second stage.

@openshift-ci

openshift-ci Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jhadvig, logonoff

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot
openshift-merge-bot Bot merged commit d516ead into openshift:main Aug 31, 2026
10 of 11 checks passed
@jhadvig jhadvig changed the title NO-JIRA: fix session-persistence tests failing due to pre-loaded storageState OCPBUGS-71237: fix session-persistence tests failing due to pre-loaded storageState Oct 20, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@jhadvig: Jira Issue OCPBUGS-71237 is in an unrecognized state (Verified) and will not be moved to the MODIFIED state.

Details

In response to this:

Analysis / Root cause:
The session-persistence.spec.ts tests have been failing 100% of the time in CI
(pull-ci-openshift-console-main-e2e-playwright — 86% overall failure rate, with these two tests contributing to every single failing run).

The root cause is that the console Playwright project injects storageState: adminStorageState into every browser context, pre-loading kubeadmin's OAuth cookies. When the session-persistence tests call performLogin(), the browser is already authenticated — page.goto(baseURL) lands on the dashboard instead of the OAuth login page, so the login element assertion ([data-test-id="login"] / #inputUsername) always times out after 30s with "element(s) not found".

Evidence:

  • auth-multiuser-login.spec.ts uses test.use({ storageState: { cookies: [], origins: [] } }) + performLogin() → 0% failure rate across 139 runs
  • session-persistence.spec.ts inherits storageState: adminStorageState + performLogin() → 100% failure rate
  • The only difference is the storageState configuration

Solution description:
Add test.use({ storageState: { cookies: [], origins: [] } }) to the describe block so each test starts with a clean, unauthenticated browser context. This matches the existing pattern in auth-multiuser-login.spec.ts.

The session-persistence tests need to control their own authentication lifecycle from scratch — they log in, delete/restart console pods, then verify the session survives. Pre-loading cookies from storageState defeats this by skipping the login page entirely.

Screenshots / screen recording:
N/A — no visual changes.

Test setup:
No additional setup required. The fix is to the test itself.

Test cases:

  • session survives console pod deletion — should now reach the OAuth login page, authenticate, delete pods, and verify session persistence
  • session survives console plugin toggle — should now reach the OAuth login page, authenticate, toggle a plugin, and verify session persistence

Browser conformance:

  • Chrome (Playwright CI uses Chromium)
  • Firefox
  • Safari (or Epiphany on Linux)

Additional info:
This is a one-line fix. The storageState override pattern is already established in the codebase at frontend/e2e/tests/console/app/auth-multiuser-login.spec.ts:8.

Made with Cursor

Summary by CodeRabbit

  • Tests
  • Improved session persistence test reliability by ensuring each test starts with a clean browser state.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. docs-approved Signifies that Docs has signed off on this PR jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. px-approved Signifies that Product Support has signed off on this PR verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants