OCPEDGE-1036: fix: latency tuning for the rt-kernel tests on AWS metal#30790
OCPEDGE-1036: fix: latency tuning for the rt-kernel tests on AWS metal#30790jeff-roche wants to merge 1 commit intoopenshift:mainfrom
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: automatic mode |
|
@jeff-roche: This pull request references OCPEDGE-1036 which is a valid jira issue. DetailsIn 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. |
|
/test ? |
|
/test e2e-gcp-ovn-rt-upgrade |
|
/payload-job periodic-ci-openshift-release-main-nightly-4.22-upgrade-from-stable-4.21-e2e-metal-ovn-single-node-rt-upgrade |
|
@jeff-roche: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command
See details on https://pr-payload-tests.ci.openshift.org/runs/ci/1e7a2f80-0b96-11f1-9252-e810dd3e02ff-0 |
|
Scheduling required tests: |
|
The payload job fails to upgrade but the RT Tests themselves pass. Addressing the upgrade failures on #30608 |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jeff-roche, qJkee The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/payload-job periodic-ci-openshift-release-main-ci-4.22-upgrade-from-stable-4.21-e2e-metal-ovn-single-node-rt-upgrade-test |
|
@jeff-roche: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command
See details on https://pr-payload-tests.ci.openshift.org/runs/ci/61996750-0c26-11f1-8539-63c794c57c62-0 |
|
/payload-job periodic-ci-openshift-release-main-ci-4.22-upgrade-from-stable-4.21-e2e-metal-ovn-single-node-rt-upgrade-test |
|
@jeff-roche: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command
See details on https://pr-payload-tests.ci.openshift.org/runs/ci/9cdf16c0-11a8-11f1-9f71-c9b6ff3ae133-0 |
|
/payload-job periodic-ci-openshift-release-main-ci-4.22-upgrade-from-stable-4.21-e2e-metal-ovn-single-node-rt-upgrade-test |
|
@jeff-roche: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command
See details on https://pr-payload-tests.ci.openshift.org/runs/ci/4d5afc30-1253-11f1-9df8-fe79311f410f-0 |
|
New changes are detected. LGTM label has been removed. |
|
/payload-job periodic-ci-openshift-release-main-ci-4.22-upgrade-from-stable-4.21-e2e-metal-ovn-single-node-rt-upgrade-test |
WalkthroughgetRealTimeWorkerNodes now returns a slice of node names and detects non-metal nodes (which forces all real-time thresholds to 7500µs). Multiple real-time test runners were refactored to use a centralized rtTestThresholds map, capture command output, wrap errors, and write timestamped per-test artifacts. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@jeff-roche: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command
See details on https://pr-payload-tests.ci.openshift.org/runs/ci/44998af0-130a-11f1-9082-40e95c4d00b8-0 |
|
@jeff-roche: This pull request references OCPEDGE-1036 which is a valid jira issue. DetailsIn 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. |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
test/extended/kernel/common.go (1)
64-68: Side effect in getter function modifies global state.
getRealTimeWorkerNodesmodifies the globalrtTestThresholdsmap, which is unexpected for a function with a "get" prefix. This couples threshold configuration to node discovery and makes the behavior harder to reason about.Consider either:
- Renaming the function to reflect it configures thresholds (e.g.,
setupRealTimeWorkerNodes)- Returning the metal status and handling threshold adjustment at the call site
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@test/extended/kernel/common.go` around lines 64 - 68, getRealTimeWorkerNodes currently mutates the global rtTestThresholds map (when nodesAreMetal is false), which is a surprising side effect for a getter; stop modifying rtTestThresholds inside getRealTimeWorkerNodes and instead either (A) rename getRealTimeWorkerNodes to setupRealTimeWorkerNodes if you intend it to configure thresholds, or (B) change getRealTimeWorkerNodes to only return the metal status (bool nodesAreMetal) and move the rtTestThresholds adjustments out to the call site so callers can set rtTestThresholds[test] = 7500 when nodesAreMetal is false; update all callers of getRealTimeWorkerNodes accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@test/extended/kernel/common.go`:
- Around line 57-68: The metal-detection currently uses node.GetLabels() and
sets nodesAreMetal = false if any worker node isn't metal, which incorrectly
flags clusters where non-RT workers are non-metal; update the logic so the metal
check is only performed for nodes that match the RT kernel condition (the same
condition used to select RT nodes) — i.e., inside the RT kernel match block
iterate those nodes, call node.GetLabels(), and only then modify nodesAreMetal
and adjust rtTestThresholds; reference variables/functions: node.GetLabels(),
nodesAreMetal, rtTestThresholds, and the RT kernel match condition so the
threshold padding runs only when RT nodes are detected as non-metal.
- Line 48: Replace the incorrect capacity argument on the nodes slice
allocation: the current call uses kubeNodes.Size() (which returns protobuf
serialized size) when constructing nodes via make([]string, 0, ...); change it
to use the number of items with len(kubeNodes.Items) so nodes = make([]string,
0, len(kubeNodes.Items)). Update the allocation site that references kubeNodes
and the nodes variable in test/extended/kernel/common.go (search for the
make([]string, 0, kubeNodes.Size()) occurrence).
In `@test/extended/kernel/tools.go`:
- Around line 165-167: The error message in runCyclictest incorrectly references
"oslat test"; update the returned fmt.Errorf string in the runCyclictest
function (where cpuCount is checked) to reference "cyclictest" (or
"runCyclictest") instead and preserve the numeric cpuCount interpolation and
wording; ensure only the test name in the message is changed so the check using
cpuCount and the fmt.Errorf call remain otherwise identical.
---
Nitpick comments:
In `@test/extended/kernel/common.go`:
- Around line 64-68: getRealTimeWorkerNodes currently mutates the global
rtTestThresholds map (when nodesAreMetal is false), which is a surprising side
effect for a getter; stop modifying rtTestThresholds inside
getRealTimeWorkerNodes and instead either (A) rename getRealTimeWorkerNodes to
setupRealTimeWorkerNodes if you intend it to configure thresholds, or (B) change
getRealTimeWorkerNodes to only return the metal status (bool nodesAreMetal) and
move the rtTestThresholds adjustments out to the call site so callers can set
rtTestThresholds[test] = 7500 when nodesAreMetal is false; update all callers of
getRealTimeWorkerNodes accordingly.
ℹ️ Review info
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to data retention organization setting
📒 Files selected for processing (2)
test/extended/kernel/common.gotest/extended/kernel/tools.go
|
Scheduling required tests: |
8de1caf to
40cfb1d
Compare
|
@jeff-roche: This pull request references OCPEDGE-1036 which is a valid jira issue. DetailsIn 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. |
|
/payload-job periodic-ci-openshift-release-main-ci-4.22-upgrade-from-stable-4.21-e2e-metal-ovn-single-node-rt-upgrade-test |
|
@jeff-roche: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command
See details on https://pr-payload-tests.ci.openshift.org/runs/ci/1732ad10-165e-11f1-9f18-6b2d93667007-0 |
|
/retest |
1 similar comment
|
/retest |
|
Scheduling required tests: |
40cfb1d to
1059dd7
Compare
|
@jeff-roche: This pull request references OCPEDGE-1036 which is a valid jira issue. DetailsIn 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. |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
test/extended/kernel/tools.go (2)
20-25: Consider guarded threshold access instead of raw map indexing.Using string keys with direct map indexing can silently fall back to
0if a key drifts, which makes failures harder to diagnose. A small helper withokchecks would make this safer.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@test/extended/kernel/tools.go` around lines 20 - 25, rtTestThresholds is being read with raw map indexing which returns 0 for missing keys; add a guarded accessor to make missing-key cases explicit. Implement a helper like getRTTestThreshold(testName string) (int, bool) or GetRTTestThreshold(testName string) (int, error) that looks up rtTestThresholds, returns the value and an ok flag (or an error) and use that helper wherever rtTestThresholds is read so callers can handle missing keys instead of silently getting 0; reference the rtTestThresholds map and replace any direct accesses with calls to getRTTestThreshold.
29-33: Persist command output even on failure paths.Current flow returns on
errbefore writing artifacts, so failure diagnostics are lost. This same pattern appears in the other runners that captureres.Proposed adjustment
res, err := oc.SetNamespace(rtNamespace).Run("exec").Args(args...).Output() + writeTestArtifacts(fmt.Sprintf("%s_%s.log", "pi_stress_standard", e2e.TimeNow().Format(time.RFC3339)), res) if err != nil { // An error here indicates thresholds were exceeded or an issue with the test return errors.Wrap(err, "error running pi_stress with the standard algorithm") } - - writeTestArtifacts(fmt.Sprintf("%s_%s.log", "pi_stress_standard", e2e.TimeNow().Format(time.RFC3339)), res)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@test/extended/kernel/tools.go` around lines 29 - 33, The command output (res) is discarded when oc.SetNamespace(...).Run("exec").Args(...).Output() returns an err; update the err != nil branch to persist the captured res before returning. Specifically, inside the error path of the block that reads res and err, write res to the test artifacts/logging (using the existing test artifact writer or logger used elsewhere in this package) with a clear filename/context, then return errors.Wrap(err, "error running pi_stress with the standard algorithm") as before. Ensure the same pattern is applied to the other runner blocks that capture res so failures always include the command output for diagnostics.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@test/extended/kernel/tools.go`:
- Around line 20-25: rtTestThresholds is being read with raw map indexing which
returns 0 for missing keys; add a guarded accessor to make missing-key cases
explicit. Implement a helper like getRTTestThreshold(testName string) (int,
bool) or GetRTTestThreshold(testName string) (int, error) that looks up
rtTestThresholds, returns the value and an ok flag (or an error) and use that
helper wherever rtTestThresholds is read so callers can handle missing keys
instead of silently getting 0; reference the rtTestThresholds map and replace
any direct accesses with calls to getRTTestThreshold.
- Around line 29-33: The command output (res) is discarded when
oc.SetNamespace(...).Run("exec").Args(...).Output() returns an err; update the
err != nil branch to persist the captured res before returning. Specifically,
inside the error path of the block that reads res and err, write res to the test
artifacts/logging (using the existing test artifact writer or logger used
elsewhere in this package) with a clear filename/context, then return
errors.Wrap(err, "error running pi_stress with the standard algorithm") as
before. Ensure the same pattern is applied to the other runner blocks that
capture res so failures always include the command output for diagnostics.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: b0195779-df43-4df7-8bf9-a8d96aabd777
📒 Files selected for processing (2)
test/extended/kernel/common.gotest/extended/kernel/tools.go
|
Scheduling required tests: |
|
/payload-job periodic-ci-openshift-release-main-ci-4.22-upgrade-from-stable-4.21-e2e-metal-ovn-single-node-rt-upgrade-test |
|
@jeff-roche: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command
See details on https://pr-payload-tests.ci.openshift.org/runs/ci/5684d340-17de-11f1-9987-ae4c2d50ffbc-0 |
Replace binary pass/fail latency detection with a three-tier analysis: - Two-tier thresholds (soft/hard) to distinguish warnings from failures - Statistical percentage-based detection (>5% CPUs over soft = systemic fail) - Structured JSON diagnostic artifacts for richer test result analysis Metal thresholds: oslat/cyclictest soft=100us hard=500us, hwlatdetect/deadline_test soft=100us hard=200us. Non-metal thresholds: soft=7500us hard=10000us. Unifies parseOslatResults and parseCyclictestResults into a single parseLatencyResults function with comprehensive statistics (max, avg, P99, per-CPU breakdown). Adds unit tests for the new parsing logic. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1059dd7 to
ceb21f5
Compare
|
@jeff-roche: This pull request references OCPEDGE-1036 which is a valid jira issue. DetailsIn 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. |
|
/payload-job periodic-ci-openshift-release-main-ci-4.22-upgrade-from-stable-4.21-e2e-metal-ovn-single-node-rt-upgrade-test |
|
@jeff-roche: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command
See details on https://pr-payload-tests.ci.openshift.org/runs/ci/7e364250-18ad-11f1-9802-7c1b2e727428-0 |
|
/test e2e-gcp-ovn-rt-upgrade |
|
Scheduling required tests: |
|
@jeff-roche: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
|
/retest |
Summary
Replaces the binary pass/fail latency detection with a smarter three-tier analysis that distinguishes real RT kernel issues from environmental noise (e.g., isolated single-CPU spikes on AWS metal instances).
Changes
Two-tier soft/hard thresholds:
Statistical percentage-based detection:
Structured JSON diagnostic artifacts:
_analysis.jsonartifact with: max, avg, P99 latency, per-CPU breakdown, soft/hard threshold counts, and overall result (PASS/WARN/FAIL)Thresholds
Code cleanup
parseOslatResultsandparseCyclictestResultsinto a singleparseLatencyResultsfunctionExpected behavior with real job data