-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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 running tests under Docker/Podman and cgroup v2 #3960
Conversation
Is this a systemd bug, or something else? It seems very strange that EDIT: Oh, I finally understand the issue. The no-internal-nodes constraint strikes again... |
OK, after merging #3954 my Added two small fixes to unit tests, which assumed systemd is there. With this, the following passes on my machine (Fedora/Podman):
Note that the above do not test runc systemd cgroup driver; for that, I usually run |
Added one more commit to fix a flake (not related to cgroup v2 but the fix is easy) |
For "make integration", the tests are run inside a Docker/Podman container. Problem is, if cgroup v2 is used, the in-container /sys/fs/cgroup/cgroup.subtree_control is empty. The added script, used as Docker entrypoint, moves the current process into a sub-cgroup, and then adds all controllers in top-level cgroup.subtree_control. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Split the test into two -- for fs and systemd cgroup managers, and only run the second one if systemd is available. Prevents the following failure during `make unittest`: > === RUN TestNilResources > manager_test.go:27: systemd not running on this host, cannot use systemd cgroups manager > --- FAIL: TestNilResources (0.22s) Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
A few cases relied on the fact that systemd is used, and thus /sys/fs/cgroup/user.slice is available. Guess what, in case of "make unittest" it might not be. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This test fails in CI sometimes with the following error: > `testcontainer test_update stopped' failed Give OOM killer some time to do its job. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
@AkihiroSuda PTAL |
Backported to 1.1 in #3976. |
For "make integration", the tests are run inside a Docker/Podman container. Problem is, if cgroup v2 is used, the in-container /sys/fs/cgroup/cgroup.subtree_control is empty.
The added script, used as Docker entrypoint, moves the current process into a sub-cgroup, and then adds all controllers in top-level cgroup.subtree_control.
Addresses #3955