Skip to content

OCPBUGS-69936: Try to stagger some test groups to help with high cpu disruption cases#31024

Open
xueqzhan wants to merge 2 commits intoopenshift:mainfrom
xueqzhan:stagger-test-runner
Open

OCPBUGS-69936: Try to stagger some test groups to help with high cpu disruption cases#31024
xueqzhan wants to merge 2 commits intoopenshift:mainfrom
xueqzhan:stagger-test-runner

Conversation

@xueqzhan
Copy link
Copy Markdown
Contributor

@xueqzhan xueqzhan commented Apr 16, 2026

Summary by CodeRabbit

  • Tests
    • Kubernetes and OpenShift test suites now start workers with a staggered delay (10s) when run via the test runner.
  • New Features
    • Test execution framework gains a configurable worker-startup delay option while preserving prior default behavior.

@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: automatic mode

@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Apr 16, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@xueqzhan: This pull request references Jira Issue OCPBUGS-69936, which is invalid:

  • expected the bug to target either version "5.0." or "openshift-5.0.", but it targets "4.22.0" instead
  • expected the bug to be in one of the following states: NEW, ASSIGNED, POST, but it is MODIFIED instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

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
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 16, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: xueqzhan

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 Apr 16, 2026
@xueqzhan
Copy link
Copy Markdown
Contributor Author

/payload-job periodic-ci-openshift-release-main-nightly-4.22-e2e-aws-ovn-upgrade-fips

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 16, 2026

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: Pro Plus

Run ID: 3a9247d8-c992-4b69-a0fb-9deb95bfed18

📥 Commits

Reviewing files that changed from the base of the PR and between 95d613e and 40a31f6.

📒 Files selected for processing (1)
  • pkg/test/ginkgo/cmd_runsuite.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • pkg/test/ginkgo/cmd_runsuite.go

Walkthrough

Added an optional worker-start stagger to the parallel-by-file test queue. A new ExecuteWithStagger method and an extended internal execute(...) parameter allow delaying each worker’s startup by workerID * workerStagger. Two test buckets now invoke the staggered execution with a 10-second stagger and tests updated to pass a zero stagger.

Changes

Cohort / File(s) Summary
Queue Execution Infrastructure
pkg/test/ginkgo/queue.go
Added ExecuteWithStagger(ctx, tests, parallelism, testOutput, maybeAbortOnFailureFn, workerStagger time.Duration). Execute(...) now delegates to ExecuteWithStagger(..., 0). Internal execute(...) signature extended to accept workerStagger and worker goroutines optionally delay startup by workerID * workerStagger (skipping when workerStagger == 0), with early exit on ctx.Done().
Test Bucket Execution
pkg/test/ginkgo/cmd_runsuite.go
Replaced calls to q.Execute(...) for the Kubernetes and OpenShift test buckets with q.ExecuteWithStagger(...), passing a final 10*time.Second workerStagger argument. Timing/recording/logging and test slice appends remain unchanged.
Unit Test Update
pkg/test/ginkgo/queue_test.go
Updated test invocation of internal execute(...) to include the new workerStagger parameter as 0. No assertions or control flow changes in the test beyond the added argument.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 9 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (9 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly describes the main change: adding stagger logic to test groups to mitigate high CPU disruption cases, which aligns with the code changes adding ExecuteWithStagger functionality.
Stable And Deterministic Test Names ✅ Passed PR changes only modify test execution scheduling via ExecuteWithStagger() and worker staggering; no Ginkgo test names (It, Describe, Context, When) are altered.
Test Structure And Quality ✅ Passed PR contains only test infrastructure and orchestration code, not Ginkgo E2E tests which the check targets.
Microshift Test Compatibility ✅ Passed This pull request does not add any new Ginkgo e2e tests. All changes are infrastructure-level modifications to the test runner that add a staggering mechanism for parallel test worker startup.
Single Node Openshift (Sno) Test Compatibility ✅ Passed This PR does not add any new Ginkgo e2e tests; changes are purely infrastructure-level modifications to the test execution scheduler with no new test definitions.
Topology-Aware Scheduling Compatibility ✅ Passed Pull request modifies only test framework infrastructure in pkg/test/ginkgo/ with no Kubernetes API types, deployment manifests, operators, or pod scheduling constraints.
Ote Binary Stdout Contract ✅ Passed The PR introduces a worker stagger mechanism using time.After() and context cancellation without any stdout writes. All code changes are in internal queue execution methods, not at the process level. No new process-level stdout operations are added.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed This PR does not add any new Ginkgo e2e tests. The changes are exclusively to test infrastructure/scheduling code in cmd_runsuite.go, queue.go, and queue_test.go. The modifications implement a worker stagger feature to delay goroutine startup during test execution, which does not introduce any IPv4 assumptions or external connectivity requirements. Since no new test cases are being defined, the IPv6 and disconnected network compatibility check is not applicable to this PR.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

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

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

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 16, 2026

@xueqzhan: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-main-nightly-4.22-e2e-aws-ovn-upgrade-fips

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/f0d3fc60-39e3-11f1-8358-bf5fcf6ed1a5-0

@openshift-ci openshift-ci Bot requested review from deads2k and sjenning April 16, 2026 22:31
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
pkg/test/ginkgo/cmd_runsuite.go (1)

665-665: Extract the stagger interval into a named constant.

The same 200*time.Millisecond value is now duplicated across both bucket call sites. Pulling it into a shared constant will make future tuning less error-prone.

Also applies to: 719-719

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/test/ginkgo/cmd_runsuite.go` at line 665, Extract the duplicated literal
200*time.Millisecond into a named package-level constant (e.g., staggerInterval
or executeStaggerInterval) and replace the two direct uses in the calls to
q.ExecuteWithStagger with that constant; update both call sites that currently
pass 200*time.Millisecond so they use the new constant for easier tuning and to
avoid duplication.
pkg/test/ginkgo/queue_test.go (1)

75-79: Add coverage for the new stagger path.

This only updates the helper signature; it still doesn't verify that staggered workers actually start later or that a canceled context stops delayed workers promptly. A focused test around ExecuteWithStagger/execute(..., workerStagger) would make the new scheduling behavior much safer to change.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/test/ginkgo/queue_test.go` around lines 75 - 79, Add a focused test for
the staggered-worker path: create a new test (e.g., Test_execute_staggered) that
uses the updated testingSuiteRunner helper (testingSuiteRunner) instrumented to
record each worker's actual start time, then call execute/ExecuteWithStagger
with a non-zero workerStagger (e.g., 50–100ms) and assert that recorded start
times for successive workers respect the stagger delta (i.e., each start >=
previous start + stagger within a small tolerance). Also add a cancellation
subtest that runs execute with a long stagger and a canceling context to verify
that canceled context prevents delayed workers from starting (no new start
timestamps after cancellation time). Ensure you reference and use execute and/or
ExecuteWithStagger and the testingSuiteRunner to locate where to hook
timestamps.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@pkg/test/ginkgo/cmd_runsuite.go`:
- Line 665: Extract the duplicated literal 200*time.Millisecond into a named
package-level constant (e.g., staggerInterval or executeStaggerInterval) and
replace the two direct uses in the calls to q.ExecuteWithStagger with that
constant; update both call sites that currently pass 200*time.Millisecond so
they use the new constant for easier tuning and to avoid duplication.

In `@pkg/test/ginkgo/queue_test.go`:
- Around line 75-79: Add a focused test for the staggered-worker path: create a
new test (e.g., Test_execute_staggered) that uses the updated testingSuiteRunner
helper (testingSuiteRunner) instrumented to record each worker's actual start
time, then call execute/ExecuteWithStagger with a non-zero workerStagger (e.g.,
50–100ms) and assert that recorded start times for successive workers respect
the stagger delta (i.e., each start >= previous start + stagger within a small
tolerance). Also add a cancellation subtest that runs execute with a long
stagger and a canceling context to verify that canceled context prevents delayed
workers from starting (no new start timestamps after cancellation time). Ensure
you reference and use execute and/or ExecuteWithStagger and the
testingSuiteRunner to locate where to hook timestamps.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: a299422c-ccfc-4cf4-8d35-9f82659e6ca9

📥 Commits

Reviewing files that changed from the base of the PR and between d7ad0db and 95d613e.

📒 Files selected for processing (3)
  • pkg/test/ginkgo/cmd_runsuite.go
  • pkg/test/ginkgo/queue.go
  • pkg/test/ginkgo/queue_test.go

@xueqzhan
Copy link
Copy Markdown
Contributor Author

/payload-aggregate periodic-ci-openshift-release-main-nightly-4.22-e2e-aws-ovn-upgrade-fips 10

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 16, 2026

@xueqzhan: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-main-nightly-4.22-e2e-aws-ovn-upgrade-fips

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/b994b260-39e5-11f1-9462-98fe04071209-0

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

@xueqzhan
Copy link
Copy Markdown
Contributor Author

/payload-aggregate periodic-ci-openshift-release-main-nightly-4.22-e2e-aws-ovn-upgrade-fips 10

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 17, 2026

@xueqzhan: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-main-nightly-4.22-e2e-aws-ovn-upgrade-fips

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/78154f90-3a60-11f1-818c-0812ff93230d-0

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

@openshift-trt
Copy link
Copy Markdown

openshift-trt Bot commented Apr 17, 2026

Job Failure Risk Analysis for sha: 40a31f6

Job Name Failure Risk
pull-ci-openshift-origin-main-e2e-vsphere-ovn-upi Low
[sig-instrumentation] Prometheus [apigroup:image.openshift.io] when installed on the cluster shouldn't report any alerts in firing state apart from Watchdog and AlertmanagerReceiversNotConfigured [Early][apigroup:config.openshift.io] [Suite:openshift/conformance/parallel]
This test has passed 0.00% of 14 runs on release 5.0 [Architecture:amd64 FeatureSet:default Installer:upi JobTier:standard Network:ovn NetworkStack:ipv4 OS:rhcos9 Owner:eng Platform:vsphere Procedure:none SecurityMode:default Topology:ha Upgrade:none] in the last week.

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/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. 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