Skip to content

Fix the system compressible test case to use drop-in files#31332

Open
ngopalak-redhat wants to merge 2 commits into
openshift:mainfrom
ngopalak-redhat:ngopalak/compressible_test
Open

Fix the system compressible test case to use drop-in files#31332
ngopalak-redhat wants to merge 2 commits into
openshift:mainfrom
ngopalak-redhat:ngopalak/compressible_test

Conversation

@ngopalak-redhat

@ngopalak-redhat ngopalak-redhat commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Post the merge of https://github.com/openshift/machine-config-operator/pull/6044/changes , We are now making it mandatory to have this /etc/openshift/kubelet.conf.d/ always present. The system compressible test was not updated while we worked on the PR. Hence this fix.

Summary by CodeRabbit

  • Tests
    • Updated system compressible behavior validation to derive the expected CPU reservation from the current kubelet auto-sizing configuration rather than older environment-based parsing.
    • The validation now resolves the configured CPU reserved value as a Kubernetes quantity, converts it to CPU cores, logs the resolved value, and verifies it is greater than zero before running weight-related assertions.

@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

openshift-ci Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 24, 2026
@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 5546d173-7c29-48a4-9388-e0fe9990aad4

📥 Commits

Reviewing files that changed from the base of the PR and between 6f70998 and ab505a0.

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

Walkthrough

The test changes how it obtains the CPU reservation value for system compressible validation. Instead of reading SYSTEM_RESERVED_CPU from /etc/node-sizing.env via string scanning and strconv.ParseFloat, it reads /etc/openshift/kubelet.conf.d/20-auto-sizing.conf, unmarshals it into a KubeletConfiguration, extracts systemReserved["cpu"], and converts the parsed resource quantity from milliCPU to cores.

Changes

System Compressible Test — CPU Reservation Source

Layer / File(s) Summary
Config parsing update
test/extended/node/system_compressible.go
Adds k8s.io/apimachinery/pkg/api/resource and sigs.k8s.io/yaml imports for the kubelet config read path.
CPU reservation lookup
test/extended/node/system_compressible.go
Reads 20-auto-sizing.conf, unmarshals KubeletConfiguration, extracts systemReserved["cpu"], converts the quantity to CPU cores, and asserts the value is greater than zero before using it in the expected cpu.weight calculation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: updating the system compressible test to use drop-in configuration files.
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 All Ginkgo titles in system_compressible.go are static strings; no dynamic node, namespace, date, or formatted values appear in test names.
Test Structure And Quality ✅ Passed The PR keeps each It focused, adds DeferCleanup for created cluster resources, and all Eventually waits have explicit timeouts with informative failure messages.
Microshift Test Compatibility ✅ Passed The Describe has a BeforeEach that calls exutil.IsMicroShiftCluster and g.Skip, so all tests in this file are gated off on MicroShift.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The test operates on a single worker node and only checks local kubelet/cgroup state; no multi-node/HA assumptions or SNO skip gaps were found.
Topology-Aware Scheduling Compatibility ✅ Passed PASS: The PR only changes an e2e test’s config parsing; it adds no deployment/controller scheduling constraints, affinities, replica logic, or topology assumptions.
Ote Binary Stdout Contract ✅ Passed New log calls use framework.Logf/GinkgoWriter inside an It block; no main/init/suite-setup stdout writes were added.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed Updated test only reads node-local kubelet/cgroup data and cluster APIs; no hardcoded IPv4, public hosts, or external downloads were found.
No-Weak-Crypto ✅ Passed The change only updates a test to parse kubelet config and compute CPU weights; no weak ciphers, custom crypto, or secret comparisons are present.
Container-Privileges ✅ Passed The PR only updates a Go test file; no container/K8s manifests or privileged settings like privileged/hostPID/allowPrivilegeEscalation are added.
No-Sensitive-Data-In-Logs ✅ Passed The added logs only print kubelet config text and CPU quantity; they don’t include passwords, tokens, PII, session IDs, or hostnames.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@ngopalak-redhat

Copy link
Copy Markdown
Contributor Author

/payload-job periodic-ci-openshift-release-main-nightly-5.0-e2e-aws-disruptive-longrunning

@openshift-ci

openshift-ci Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

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

  • periodic-ci-openshift-release-main-nightly-5.0-e2e-aws-disruptive-longrunning

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/006a3fe0-6f86-11f1-8dce-6e93fa2429c9-0

@openshift-ci

openshift-ci Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ngopalak-redhat
Once this PR has been reviewed and has the lgtm label, please assign mrunalp 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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 `@test/extended/node/system_compressible.go`:
- Around line 71-73: The `resource.MustParse(cpuQuantity)` call on line 71 will
panic if the configuration value is malformed, causing the test to abort without
a clear error message. Replace `resource.MustParse(cpuQuantity)` with
`resource.ParseQuantity(cpuQuantity)` and add explicit error handling to check
if parsing fails, then use `o.Expect()` or a similar test assertion to fail
gracefully with a descriptive error message explaining that the CPU quantity
could not be parsed.
🪄 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 YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 1d1b3519-963a-4320-9a09-a1e447c4af92

📥 Commits

Reviewing files that changed from the base of the PR and between a2cb43f and 6f70998.

📒 Files selected for processing (1)
  • test/extended/node/system_compressible.go

Comment thread test/extended/node/system_compressible.go Outdated
@ngopalak-redhat

Copy link
Copy Markdown
Contributor Author

/payload-job periodic-ci-openshift-release-main-nightly-5.0-e2e-aws-disruptive-longrunning

@openshift-ci

openshift-ci Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

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

  • periodic-ci-openshift-release-main-nightly-5.0-e2e-aws-disruptive-longrunning

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/59b0d0c0-6fc0-11f1-89f1-1bdda8b83aee-0

Fix based on coderabbit suggestion

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@openshift-ci openshift-ci Bot added the ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review label Jun 26, 2026
@ngopalak-redhat ngopalak-redhat marked this pull request as ready for review June 26, 2026 12:19
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 26, 2026
@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-ci

openshift-ci Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

@ngopalak-redhat: The following tests 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-aws-ovn-fips ab505a0 link true /test e2e-aws-ovn-fips
ci/prow/e2e-metal-ipi-ovn-ipv6 ab505a0 link true /test e2e-metal-ipi-ovn-ipv6
ci/prow/e2e-gcp-ovn ab505a0 link true /test e2e-gcp-ovn
ci/prow/e2e-aws-ovn-serial-2of2 ab505a0 link true /test e2e-aws-ovn-serial-2of2

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

ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant