docker / docker/docker-py

Skip cgroups v2 tests

Open
#2,653 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
7.2k
Forks
1.7k
Avg merge
13d 8h
Merged PRs (30d)
2

Description

When running the integration tests on a machine with cgroups v2 (e.g. Fedora 31) they all fail because Docker Engine doesn't support it yet.

Moby implemented a check to verify the cgroups version to avoid failures. When running make test they skip and inform about this scenario

---> Making bundle: .integration-daemon-start (in bundles/test-integration)
Using test binary docker
# cgroup v2 requires TEST_SKIP_INTEGRATION_CLI to be set

example of a failing integration test

___________________________________ BuildTest.test_build_in_context_abs_dockerfile ___________________________________
tests/integration/api_build_test.py:580: in test_build_in_context_abs_dockerfile
    self.client.start(ctnr)
docker/utils/decorators.py:19: in wrapped
    return f(self, resource_id, *args, **kwargs)
docker/api/container.py:1108: in start
    self._raise_for_status(res)
docker/api/client.py:263: in _raise_for_status
    raise create_api_error_from_http_exception(e)
docker/errors.py:31: in create_api_error_from_http_exception
    raise cls(e, response=response, explanation=explanation)
E   APIError: 500 Server Error: Internal Server Error ("cgroups: cgroup mountpoint does not exist: unknown")

system details

➜  ~ docker version
Client: Docker Engine - Community
 Version:           19.03.10
 API version:       1.40
 Go version:        go1.13.10
 Git commit:        9424aeaee9
 Built:             Thu May 28 22:18:06 2020
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.12
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.10
  Git commit:       48a66213fe
  Built:            Mon Jun 22 15:45:28 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.2.13
  GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

➜  ~ cat /etc/os-release 
NAME=Fedora
VERSION="31 (Workstation Edition)"
ID=fedora
VERSION_ID=31
VERSION_CODENAME=""
PLATFORM_ID="platform:f31"
PRETTY_NAME="Fedora 31 (Workstation Edition)"
ANSI_COLOR="0;34"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:31"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f31/system-administrators-guide/"
SUPPORT_URL="https://fedoraproject.org/wiki/Communicating_and_getting_help"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=31
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=31
PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy"
VARIANT="Workstation Edition"
VARIANT_ID=workstation

➜  ~ mount | grep -i cgroup
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,seclabel)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,relatime,seclabel,name=systemd)
``

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with make test and the integration-test entry points, including tests/integration/api_build_test.py, and inspect how TEST_SKIP_INTEGRATION_CLI is handled. Compare the cgroups v2 detection behavior described for Moby. Done means integration tests on cgroups v2 are skipped with an explanatory message instead of failing with the cgroup mountpoint error.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, linux, python
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.