opencontainers / runc

CLI tool for spawning and running containers according to the OCI specification
https://www.opencontainers.org/
Apache License 2.0
11.87k stars 2.11k forks source link

cpu burst test failures on Ubuntu 24.04 #4373

Closed kolyshkin closed 2 months ago

kolyshkin commented 2 months ago

Description

Observed in https://github.com/opencontainers/runc/pull/4370, https://github.com/opencontainers/runc/pull/4360. Was not happening 3 days ago.

not ok 251 cpu burst
# (from function `check_cgroup_value' in file tests/integration/helpers.bash, line 270,
#  from function `check_cpu_burst' in file tests/integration/helpers.bash, line 320,
#  in test file tests/integration/update.bats, line 343)
#   `check_cpu_burst 500000' failed
# runc spec --rootless (status=0):
#
# runc run -d --console-socket /tmp/bats-run-E7MhUu/runc.72ZYse/tty/sock test_update (status=0):
#
# current 0 !? 0
# runc update test_update --cpu-period 900000 --cpu-burst 500000 (status=0):
#
# current 500000 !? 500

Suddenly it fails for me locally, too:

 ✗ cpu burst
   (from function `check_cgroup_value' in file tests/integration/helpers.bash, line 270,
    from function `check_cpu_burst' in file tests/integration/helpers.bash, line 320,
    in test file tests/integration/update.bats, line 343)
     `check_cpu_burst 500000' failed
   runc spec (status=0):

   runc run -d --console-socket /tmp/bats-run-7HL8bU/runc.7u79IU/tty/sock test_update (status=0):

   current 0 !? 0
   runc update test_update --cpu-period 900000 --cpu-burst 500000 (status=0):

   current 500000 !? 500

Steps to reproduce the issue

1. 2. 3.

Describe the results you received and expected

no failures

What version of runc are you using?

[kir@kir-tp1 runc]$ ./runc --version runc version 1.2.0-rc.2+dev commit: v1.2.0-rc.2-31-g6602681d spec: 1.2.0 go: go1.22.5 libseccomp: 2.5.5

Host OS information

No response

Host kernel information

No response

kolyshkin commented 2 months ago

Relevant commits/PRs:

kolyshkin commented 2 months ago

This is probably caused by this kernel commit: https://lore.kernel.org/all/20240424132438.514720-1-serein.chengyu@huawei.com/

I.e. the new behavior is right, the old one is wrong. To account for older kernels we have to check both values.