Skip to content

chore(ci): adjust Playwright config for lower CPU usage#4248

Open
zdrapela wants to merge 6 commits intoredhat-developer:mainfrom
zdrapela:pw-cpu-adjust
Open

chore(ci): adjust Playwright config for lower CPU usage#4248
zdrapela wants to merge 6 commits intoredhat-developer:mainfrom
zdrapela:pw-cpu-adjust

Conversation

@zdrapela
Copy link
Member

@zdrapela zdrapela commented Feb 13, 2026

Description

The setting's video.mode: on is consuming usually 9 CPUs.

  • video capturing only on the first retry results in the need for 8 CPUs peak.
  • video capturing off results in 6.7 CPUs peak

To keep us informed on what's happening, the PR enables tracing for all the test cases (even on the passing ones). It has a negligible effect of 0.7 CPU (on vs off).

Also, screenshots will be kept for all the test cases (let's check if this makes sense, or if it's redundant).

Which issue(s) does this PR fix

  • Fixes #?

PR acceptance criteria

Please make sure that the following steps are complete:

  • GitHub Actions are completed and successful
  • Unit Tests are updated and passing
  • E2E Tests are updated and passing
  • Documentation is updated if necessary (requirement for new features)
  • Add a screenshot if the change is UX/UI related

How to test changes / Special notes to the reviewer

@openshift-ci openshift-ci bot requested a review from gustavolira February 13, 2026 11:16
@openshift-ci
Copy link

openshift-ci bot commented Feb 13, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign rostalan for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@rhdh-qodo-merge
Copy link

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🔒 No security concerns identified
⚡ No major issues detected
📚 Focus areas based on broader codebase context

Performance

trace: "on" and screenshot: "on" will collect artifacts for every test, including passing ones, which may increase IO/CPU usage and storage in CI. This also conflicts with the nearby comment indicating traces are intended for retries/failures; validate that this change won’t regress CI runtime/flakiness or bloat test-results/uploaded artifacts. (Ref 2)

trace: "on",
screenshot: "on",
...devices["Desktop Chrome"],
viewport: { width: 1920, height: 1080 },
video: {
  mode: "on-first-retry",
  size: { width: 1920, height: 1080 },

Reference reasoning: The existing Playwright config uses failure-focused artifact collection (trace retained on failure / screenshots only on failure), aligning with the intent expressed in the comment. Keeping artifacts scoped to failures/retries matches the established approach in the repository and avoids the overhead of always-on recording.

📄 References
  1. redhat-developer/rhdh/e2e-tests/playwright/utils/common.ts [553-564]
  2. redhat-developer/rhdh/e2e-tests/playwright.config.ts [1-40]
  3. redhat-developer/rhdh/e2e-tests/playwright.config.ts [79-104]
  4. redhat-developer/rhdh/e2e-tests/playwright.config.ts [133-156]
  5. redhat-developer/rhdh/e2e-tests/playwright.config.ts [169-189]
  6. redhat-developer/rhdh/e2e-tests/playwright.config.ts [189-233]
  7. redhat-developer/rhdh/e2e-tests/playwright.config.ts [241-285]
  8. redhat-developer/rhdh/e2e-tests/playwright.config.ts [121-132]

@rhdh-qodo-merge
Copy link

PR Type

Enhancement


Description

  • Changed video recording mode from always-on to on-first-retry to reduce CPU usage

  • Enabled tracing for all test cases instead of only on failures

  • Enabled screenshot capture for all test cases instead of only on failures


File Walkthrough

Relevant files
Configuration changes
playwright.config.ts
Adjust Playwright test recording and tracing settings       

e2e-tests/playwright.config.ts

  • Modified video recording mode from "on" to "on-first-retry" to
    decrease CPU consumption
  • Changed trace setting from "retain-on-failure" to "on" to capture
    traces for all tests
  • Changed screenshot setting from "only-on-failure" to "on" to capture
    screenshots for all tests
+3/-3     

@rhdh-qodo-merge
Copy link

rhdh-qodo-merge bot commented Feb 13, 2026

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Limit tracing to failures
Suggestion Impact:The trace configuration was changed away from "on" to "off", reducing tracing overhead (though not using the suggested "retain-on-failure" value).

code diff:

-    /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
-    trace: "on",
+    trace: "off",
     screenshot: "on",

To reduce CPU and disk overhead, change the trace setting from on to
retain-on-failure.

e2e-tests/playwright.config.ts [63]

-trace: "on",
+trace: "retain-on-failure",

[Suggestion processed]

Suggestion importance[1-10]: 8

__

Why: This suggestion correctly identifies that setting trace to "on" increases resource usage, contradicting the PR's likely intent to optimize performance, and proposes reverting to the more efficient previous setting.

Medium
Limit screenshots to failures

To lower CPU usage and disk writes, change the screenshot setting from on to
only-on-failure.

e2e-tests/playwright.config.ts [64]

-screenshot: "on",
+screenshot: "only-on-failure",
  • Apply / Chat
Suggestion importance[1-10]: 8

__

Why: This suggestion correctly identifies that setting screenshot to "on" increases resource usage, contradicting the PR's likely intent to optimize performance, and proposes reverting to the more efficient previous setting.

Medium
  • Update

@github-actions
Copy link
Contributor

@zdrapela
Copy link
Member Author

/test e2e-ocp-helm

@zdrapela
Copy link
Member Author

/hold

@zdrapela
Copy link
Member Author

/test e2e-ocp-helm

@github-actions
Copy link
Contributor

🚫 Image Push Skipped.

The container image push was skipped because the build was skipped (either due to [skip-build] tag or no relevant changes with existing image)

@github-actions
Copy link
Contributor

🚫 Image Push Skipped.

The container image push was skipped because the build was skipped (either due to [skip-build] tag or no relevant changes with existing image)

This reverts commit 4fe3487.
@github-actions
Copy link
Contributor

🚫 Image Push Skipped.

The container image push was skipped because the build was skipped (either due to [skip-build] tag or no relevant changes with existing image)

@zdrapela
Copy link
Member Author

/unhold

@github-actions
Copy link
Contributor

🚫 Image Push Skipped.

The container image push was skipped because the build was skipped (either due to [skip-build] tag or no relevant changes with existing image)

@sonarqubecloud
Copy link

@github-actions
Copy link
Contributor

🚫 Image Push Skipped.

The container image push was skipped because the build was skipped (either due to [skip-build] tag or no relevant changes with existing image)

@openshift-ci
Copy link

openshift-ci bot commented Feb 13, 2026

@zdrapela: 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-ocp-helm 045ceaa link true /test e2e-ocp-helm

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant