Skip to content

Commit

Permalink
tests/int: fix update cpu.idle failure on CS9
Browse files Browse the repository at this point in the history
Systemd v252 (available in CentOS Stream 9 in our CI) added support
for setting cpu.idle (see [1]). The way it works is:
 - if CPUWeight == 0, cpu.idle is set to 1;
 - if CPUWeight != 0, cpu.idle is set to 0.

This behavior breaks the existing test case, as described in [2].

To fix, skip the last check in the test case in case a newer systemd
is used.

Fixes: opencontainers#3786

[1] systemd/systemd#23299
[2] opencontainers#3786

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
  • Loading branch information
kolyshkin committed Apr 3, 2023
1 parent 614acbb commit d096fbb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/integration/update.bats
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,8 @@ EOF
check_cgroup_value "cpu.idle" "$val"
done

# https://github.com/opencontainers/runc/issues/3786
[ "$(systemd_version)" -ge 252 ] && return
# test update other option won't impact on cpu.idle
runc update --cpu-period 10000 test_update
[ "$status" -eq 0 ]
Expand Down

0 comments on commit d096fbb

Please sign in to comment.