Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CGroupsV2 test #14355

Merged
merged 3 commits into from
Sep 13, 2023
Merged

Fix CGroupsV2 test #14355

merged 3 commits into from
Sep 13, 2023

Conversation

mgencur
Copy link
Contributor

@mgencur mgencur commented Sep 12, 2023

The tests sometimes fail with CGroups V2:

  === CONT  TestShouldHaveCgroupReadOnly
    cgroup_test.go:155: Error getting cgroup information: strconv.Atoi: parsing "max": invalid syntax 
  === CONT  TestMustHaveCgroupConfigured
    cgroup_test.go:90: using cgroupv2
    cgroup_test.go:120: /sys/fs/cgroup/cpu.max = 100000, want: 1000
    cgroup_test.go:120: /sys/fs/cgroup/cpu.weight = 5, want: 128 

Proposed Changes

  • Store CGroups information as strings (e.g. cgroup/cpu.max or cgroup/memory.max can be a string or have multiple values)
  • Compute cpu.max correctly for CGroups V2

Release Note


@knative-prow knative-prow bot added area/test-and-release It flags unit/e2e/conformance/perf test issues for product features size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 12, 2023
@codecov
Copy link

codecov bot commented Sep 12, 2023

Codecov Report

Patch coverage has no change and project coverage change: +0.01% 🎉

Comparison is base (a8a8be2) 86.13% compared to head (045dfa4) 86.15%.
Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #14355      +/-   ##
==========================================
+ Coverage   86.13%   86.15%   +0.01%     
==========================================
  Files         196      196              
  Lines       14781    14787       +6     
==========================================
+ Hits        12732    12739       +7     
- Misses       1742     1743       +1     
+ Partials      307      305       -2     

see 6 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dprotaso
Copy link
Member

/assign @nak3

@nak3
Copy link
Contributor

nak3 commented Sep 13, 2023

Thank you so much!
I realized that why previous PR passed the CI on upstream. We need to update ubuntu-20.04 to ubustu-latest which uses cgroup v2 in test step. (I updated build step only).

https://github.com/mgencur/serving-1/blob/cgroups_v2_fix/.github/workflows/kind-e2e.yaml#L85

Could you update it to ubuntu-latest?

@mgencur
Copy link
Contributor Author

mgencur commented Sep 13, 2023

Could you update it to ubuntu-latest?

@nak3 Thanks for the pointer. Updated.

@nak3
Copy link
Contributor

nak3 commented Sep 13, 2023

/lgtm
/approve

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Sep 13, 2023
@knative-prow
Copy link

knative-prow bot commented Sep 13, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mgencur, nak3

The full list of commands accepted by this bot can be found here.

The pull request process is described here

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

@knative-prow knative-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 13, 2023
@knative-prow knative-prow bot merged commit 32c2732 into knative:main Sep 13, 2023
70 checks passed
mgencur added a commit to mgencur/serving-1 that referenced this pull request Sep 13, 2023
* Fix CGroupsV2 test

* Fix comment
openshift-merge-robot pushed a commit to openshift-knative/serving that referenced this pull request Sep 13, 2023
* Fix CGroupsV2 test

* Fix comment
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/knative-serving that referenced this pull request Sep 13, 2023
* Fix CGroupsV2 test

* Fix comment
openshift-merge-robot pushed a commit to openshift-knative/serving that referenced this pull request Sep 14, 2023
* Fix CGroupsV2 test

* Fix comment

Co-authored-by: Martin Gencur <mgencur@redhat.com>
skonto pushed a commit to skonto/serving that referenced this pull request Oct 5, 2023
* Fix CGroupsV2 test

* Fix comment

Co-authored-by: Martin Gencur <mgencur@redhat.com>
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. area/test-and-release It flags unit/e2e/conformance/perf test issues for product features lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants