Skip to content

CONSOLE-5196: Fix Playwright CI timeout with globalTimeout and parallel workers#16780

Open
rhamilto wants to merge 3 commits into
openshift:mainfrom
rhamilto:CONSOLE-5196
Open

CONSOLE-5196: Fix Playwright CI timeout with globalTimeout and parallel workers#16780
rhamilto wants to merge 3 commits into
openshift:mainfrom
rhamilto:CONSOLE-5196

Conversation

@rhamilto

@rhamilto rhamilto commented Jul 20, 2026

Copy link
Copy Markdown
Member

Analysis / Root cause:

The Playwright e2e suite was exceeding Prow's 2-hour hard timeout. With 299 tests, 55 retries, and a single worker (serial execution), the container was killed mid-run with exit code 127 (ContainerFailed). This prevented clean JUnit output and artifact collection, masking the actual test results.

Observed in PR #16741: https://storage.googleapis.com/test-platform-results/pr-logs/pull/openshift_console/16741/pull-ci-openshift-console-main-e2e-playwright/2079191239445450752/build-log.txt

Solution description:

  1. Add globalTimeout to playwright.config.ts — 110 minutes in CI (10 min headroom before Prow's 2h kill). Playwright exits cleanly, produces JUnit results, and the artifact copy trap runs. Overridable via GLOBAL_TIMEOUT_MS env var. Unlimited locally (Playwright default).

  2. Default to WORKERS=2 in test-prow-playwright-e2e.sh — cuts wall-clock time roughly in half. The WORKERS env var was already supported by the Playwright config but was never set. Overridable at the job level.

  3. Simplify workers config — remove the isCI ? 1 : undefined fallback since WORKERS is now always set in CI. Locally, Playwright uses its default (half the CPU cores).

Screenshots / screen recording:

N/A — CI infrastructure only, no UI changes.

Test setup:

No special setup required.

Test cases:

  • grep -n globalTimeout frontend/playwright.config.ts — confirm it's set
  • grep -n WORKERS test-prow-playwright-e2e.sh — confirm it's exported
  • Re-trigger e2e-playwright CI job to verify the suite completes within the 2h budget

Browser conformance:

N/A — no UI changes.

Additional info:

The individual test failures in the PR #16741 log (poll-console-updates, project-dashboard, etc.) are pre-existing flakes, not regressions. The container failure was purely a timeout issue from running too many tests serially.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Improved E2E execution controls: Playwright now allows globalTimeout and workers to be set via environment variables (with sensible fallbacks), and Chrome runs with reduced timer throttling. The Playwright CSP test runner also defaults WORKERS to 2 when unset.
    • Updated E2E specs for stability: poll-console update toast assertions now wait for two successful polling responses; YAML editor readiness checks are more robust; route loading uses a stable UI target; favorites tests try to clear persisted favorites first and tighten visibility timeouts.

…el workers

The Playwright e2e suite was exceeding Prow's 2-hour timeout with 299+
tests running on a single worker. The container was killed mid-run
(exit code 127), preventing clean JUnit output and artifact collection.

Add a 110-minute globalTimeout so Playwright exits cleanly before Prow
kills the process, and default to 2 workers in the Prow entrypoint to
cut wall-clock time. Both values are env-var overridable.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.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-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 20, 2026
@openshift-ci-robot

openshift-ci-robot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

@rhamilto: This pull request references CONSOLE-5196 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the epic to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Analysis / Root cause:

The Playwright e2e suite was exceeding Prow's 2-hour hard timeout. With 299 tests, 55 retries, and a single worker (serial execution), the container was killed mid-run with exit code 127 (ContainerFailed). This prevented clean JUnit output and artifact collection, masking the actual test results.

Observed in PR #16741: https://storage.googleapis.com/test-platform-results/pr-logs/pull/openshift_console/16741/pull-ci-openshift-console-main-e2e-playwright/2079191239445450752/build-log.txt

Solution description:

  1. Add globalTimeout to playwright.config.ts — 110 minutes in CI (10 min headroom before Prow's 2h kill). Playwright exits cleanly, produces JUnit results, and the artifact copy trap runs. Overridable via GLOBAL_TIMEOUT_MS env var. Unlimited locally (Playwright default).

  2. Default to WORKERS=2 in test-prow-playwright-e2e.sh — cuts wall-clock time roughly in half. The WORKERS env var was already supported by the Playwright config but was never set. Overridable at the job level.

  3. Simplify workers config — remove the isCI ? 1 : undefined fallback since WORKERS is now always set in CI. Locally, Playwright uses its default (half the CPU cores).

Screenshots / screen recording:

N/A — CI infrastructure only, no UI changes.

Test setup:

No special setup required.

Test cases:

  • grep -n globalTimeout frontend/playwright.config.ts — confirm it's set
  • grep -n WORKERS test-prow-playwright-e2e.sh — confirm it's exported
  • Re-trigger e2e-playwright CI job to verify the suite completes within the 2h budget

Browser conformance:

N/A — no UI changes.

Additional info:

The individual test failures in the PR #16741 log (poll-console-updates, project-dashboard, etc.) are pre-existing flakes, not regressions. The container failure was purely a timeout issue from running too many tests serially.

🤖 Generated with Claude Code

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.

@coderabbitai

coderabbitai Bot commented Jul 20, 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: e1764cde-02d5-459a-9683-4042334231c3

📥 Commits

Reviewing files that changed from the base of the PR and between 333007a and 317a3b4.

📒 Files selected for processing (2)
  • frontend/e2e/tests/console/app/poll-console-updates.spec.ts
  • frontend/e2e/tests/console/favorites/favorites.spec.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • frontend/e2e/tests/console/favorites/favorites.spec.ts
  • frontend/e2e/tests/console/app/poll-console-updates.spec.ts

Walkthrough

Playwright now supports environment-configured global timeouts and worker counts. E2E tests add polling synchronization, stable readiness checks, and persisted Favorites-state cleanup.

Changes

E2E reliability updates

Layer / File(s) Summary
Playwright execution controls
frontend/playwright.config.ts, test-prow-playwright-e2e.sh
Environment variables configure global timeout and workers; the Prow script defaults WORKERS to 2, and Chrome disables background timer throttling.
Poll-based console synchronization
frontend/e2e/tests/console/app/poll-console-updates.spec.ts
Console update tests wait for two successful polling cycles before changing mocked responses and checking notification behavior.
Stable readiness and test-state setup
frontend/e2e/pages/yaml-editor-page.ts, frontend/e2e/tests/console/crud/other-routes.spec.ts, frontend/e2e/tests/console/favorites/favorites.spec.ts
E2E checks use stable readiness elements and explicit timeouts, while Favorites tests reset persisted settings before validation.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: jhadvig, stefanonardo

🚥 Pre-merge checks | ✅ 14 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Test Structure And Quality ⚠️ Warning favorites.spec.ts uses one It for add/display/remove/limit flows and patches a shared ConfigMap without afterEach cleanup. Split the scenario into focused tests and add BeforeEach/AfterEach cleanup or state restoration for the favorites ConfigMap.
✅ Passed checks (14 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: reducing Playwright CI timeouts by setting globalTimeout and parallel workers.
Description check ✅ Passed The description covers root cause, solution, test setup, test cases, and additional info, with only minor template deviations like N/A browser conformance.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 No new runtime-dependent test titles were introduced; the touched specs use static names, and the one interpolated title is derived from a fixed route list.
Microshift Test Compatibility ✅ Passed Touched changes are Playwright-only; no new Ginkgo tests or MicroShift-unsupported APIs were introduced by this PR.
Single Node Openshift (Sno) Test Compatibility ✅ Passed Touched tests are Playwright specs/page objects, not Ginkgo; no multi-node/HA assumptions or SNO exclusions were found.
Topology-Aware Scheduling Compatibility ✅ Passed Only Playwright E2E test files changed; no manifests, controllers, or scheduling constraints were introduced.
Ote Binary Stdout Contract ✅ Passed Edited files are Playwright config/tests only; scans found no stdout writes or process-level hooks like main/TestMain/BeforeSuite.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed Changed tests use only relative/internal routes and cluster fixtures; no hardcoded IPv4 literals, host formatting bugs, or public internet dependencies found.
No-Weak-Crypto ✅ Passed Changed files add CI/test timing logic only; no MD5/SHA1/DES/RC4/ECB or custom crypto, and no secret/token comparisons found.
Container-Privileges ✅ Passed The full PR diff only changes Playwright config, a shell script, and e2e tests; no privileged/K8s security settings appear anywhere in the patch.
No-Sensitive-Data-In-Logs ✅ Passed No new logging of secrets/PII found; changes only adjust timeouts/workers/tests, and the shell script still disables xtrace around kubeadmin-password handling.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@openshift-ci
openshift-ci Bot requested review from jhadvig and stefanonardo July 20, 2026 17:33
@openshift-ci

openshift-ci Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rhamilto

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-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 20, 2026

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@frontend/playwright.config.ts`:
- Line 52: Update the globalTimeout configuration expression to distinguish an
explicitly provided GLOBAL_TIMEOUT_MS value of "0" from an unset or invalid
value. Use the parsed environment value whenever GLOBAL_TIMEOUT_MS is explicitly
present, and only apply the isCI-based 110-minute default when the variable is
absent.
- Line 88: Update the workers configuration to preserve valid WORKERS values,
including Playwright percentage strings, instead of coercing them with parseInt.
Validate the environment value before use and pass the original string through
unchanged when valid, while retaining undefined when WORKERS is unset and
rejecting malformed values such as “2foo”.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: 96cb9129-8fef-4082-aaa6-786ec342575a

📥 Commits

Reviewing files that changed from the base of the PR and between a70992e and 9c0fd77.

📒 Files selected for processing (2)
  • frontend/playwright.config.ts
  • test-prow-playwright-e2e.sh

testDir: './e2e/tests',
testMatch: '**/*.spec.ts',
forbidOnly: isCI,
globalTimeout: parseInt(process.env.GLOBAL_TIMEOUT_MS || '0', 10) || (isCI ? 110 * 60 * 1000 : 0),

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the relevant config file with line numbers.
sed -n '1,160p' frontend/playwright.config.ts | cat -n

Repository: openshift/console

Length of output: 5460


🏁 Script executed:

#!/bin/bash
set -euo pipefail
sed -n '1,160p' frontend/playwright.config.ts | cat -n

Repository: openshift/console

Length of output: 5460


🏁 Script executed:

#!/bin/bash
set -euo pipefail
pwd
ls

Repository: openshift/console

Length of output: 844


🌐 Web query:

Playwright globalTimeout 0 meaning disable timeout documentation

💡 Result:

In Playwright, setting globalTimeout to 0 means that the timeout behavior is disabled, allowing the test suite to run for an unlimited amount of time [1][2]. The globalTimeout configuration option defines the maximum time in milliseconds that the entire test suite is allowed to run [1]. By default, there is no global timeout (i.e., it is unlimited) [3][4]. When you explicitly set globalTimeout to 0, you are effectively choosing to disable any automatic termination of the test run based on duration, which can be useful if you do not want Playwright to stop the process prematurely [1][2]. This is distinct from other timeout settings in Playwright, where specific values are used to enforce constraints on individual tests, actions, or hooks to prevent resource wastage [3][4].

Citations:


Honor an explicit zero timeout override.

GLOBAL_TIMEOUT_MS=0 is treated as unset in CI because of ||, so the 110-minute default still applies. Check for an explicit env value before falling back.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@frontend/playwright.config.ts` at line 52, Update the globalTimeout
configuration expression to distinguish an explicitly provided GLOBAL_TIMEOUT_MS
value of "0" from an unset or invalid value. Use the parsed environment value
whenever GLOBAL_TIMEOUT_MS is explicitly present, and only apply the isCI-based
110-minute default when the variable is absent.

Source: Path instructions

},

workers: process.env.WORKERS ? parseInt(process.env.WORKERS, 10) : isCI ? 1 : undefined,
workers: process.env.WORKERS ? parseInt(process.env.WORKERS, 10) : undefined,

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.

🚀 Performance & Scalability | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail
rg -n 'WORKERS|workers' frontend test-prow-playwright-e2e.sh
rg -n '"`@playwright/test`"|`@playwright/test`@' package.json yarn.lock frontend/package.json frontend/yarn.lock 2>/dev/null || true

Repository: openshift/console

Length of output: 694


Preserve WORKERS syntax instead of coercing it with parseInt.
parseInt accepts malformed values like 2foo and strips supported Playwright percentage forms such as 50%. Validate the env var first, or pass through a valid worker string unchanged.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@frontend/playwright.config.ts` at line 88, Update the workers configuration
to preserve valid WORKERS values, including Playwright percentage strings,
instead of coercing them with parseInt. Validate the environment value before
use and pass the original string through unchanged when valid, while retaining
undefined when WORKERS is unset and rejecting malformed values such as “2foo”.

Source: Path instructions

@rhamilto

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

1 similar comment
@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

@rhamilto

Copy link
Copy Markdown
Member Author

/test e2e-gcp-console
/test e2e-playwright

@rhamilto

Copy link
Copy Markdown
Member Author

/test e2e-playwright

Tests completed in 46m42s, but there were 5 failures of flaky tests.

poll-console-updates: Rewrite to use mutable closure variables with
single route handlers instead of stacking multiple page.route() calls.
Wait for two check-updates responses before switching payloads so the
component's prev/current comparison refs are initialized. Add
--disable-background-timer-throttling to prevent Chromium from
throttling the 15s polling interval under CI load.

other-routes events: Replace getByRole('row').first() with
getByTestId('event-totals') to avoid asserting visibility on a
react-virtualized row that may be positioned off-screen.

yaml-editor: Increase waitForEditorReady timeout from 30s to 60s with
a two-phase wait (mounting then ready) to accommodate the multi-stage
lazy loading chain in CI.

favorites: Clear stale favorites via patchConfigMap before the test
runs and increase the no-favorites-message assertion timeout to allow
user preferences to load.

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

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@frontend/e2e/tests/console/app/poll-console-updates.spec.ts`:
- Around line 81-88: Update the polling sequence in the test around
updatesPayload and refresh-web-console so it explicitly waits for the
error-state poll to complete before setting manifestAbort to false. Ensure the
manifest remains aborted while the updated plugin list is observed, then enable
it and verify the toast behavior, rather than relying on the immediate negative
attachment assertion.

In `@frontend/e2e/tests/console/favorites/favorites.spec.ts`:
- Around line 8-17: Update the error handling in the “Clear any stale favorites
from prior runs” test step to ignore only a 404 indicating the ConfigMap is
missing. Re-throw authentication, API, patch, and all other errors so the test
fails rather than continuing with stale favorites.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: df6254d0-a787-4d10-8a17-5e5b0f3d4179

📥 Commits

Reviewing files that changed from the base of the PR and between 9c0fd77 and 333007a.

📒 Files selected for processing (5)
  • frontend/e2e/pages/yaml-editor-page.ts
  • frontend/e2e/tests/console/app/poll-console-updates.spec.ts
  • frontend/e2e/tests/console/crud/other-routes.spec.ts
  • frontend/e2e/tests/console/favorites/favorites.spec.ts
  • frontend/playwright.config.ts

Comment thread frontend/e2e/tests/console/app/poll-console-updates.spec.ts
Comment on lines +8 to +17
await test.step('Clear any stale favorites from prior runs', async () => {
try {
await k8sClient.patchConfigMap(
'user-settings-kubeadmin',
'openshift-console-user-settings',
{ 'console.favorites': '[]' },
);
} catch {
// ConfigMap may not exist yet
}

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.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

rg -n -C 5 '\bpatchConfigMap\s*\(' frontend/e2e

Repository: openshift/console

Length of output: 2498


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

sed -n '369,430p' frontend/e2e/clients/kubernetes-client.ts

Repository: openshift/console

Length of output: 2204


Only ignore a missing ConfigMap here

Do not suppress patch failures other than a 404 from the ConfigMap lookup; auth, API, or patch errors should fail the test instead of continuing with stale favorites.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@frontend/e2e/tests/console/favorites/favorites.spec.ts` around lines 8 - 17,
Update the error handling in the “Clear any stale favorites from prior runs”
test step to ignore only a 404 indicating the ConfigMap is missing. Re-throw
authentication, API, patch, and all other errors so the test fails rather than
continuing with stale favorites.

…es tests

poll-console-updates: Add x-mock header to route.fulfill() responses and
filter on it in waitForBaseline(). If the route mock fails to intercept
requests in CI, the baseline promise hangs immediately instead of silently
resolving from real server responses (which would cause the toast to never
appear). Reduce expect timeouts from 300s to 60s since they exceed the
120s test timeout anyway.

favorites: Navigate explicitly to / after warmupSPA and assert the
Overview heading is visible. In CI the user-settings lastNamespace can
redirect to a different page where the favorite button is already active,
causing the click to remove the favorite rather than open the dialog.

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

Copy link
Copy Markdown
Member Author

/test e2e-playwright

1 similar comment
@rhamilto

Copy link
Copy Markdown
Member Author

/test e2e-playwright

@openshift-ci

openshift-ci Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

@rhamilto: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-playwright 317a3b4 link false /test e2e-playwright

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

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. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants