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

Test for systemd cgroupdriver memory setting #36172

Merged
merged 1 commit into from
Mar 22, 2018

Conversation

kolyshkin
Copy link
Contributor

@kolyshkin kolyshkin commented Jan 31, 2018

This is a test case for issue #35123, making sure we can set container's memory limit when using native.cgroupdriver=systemd.

@kolyshkin
Copy link
Contributor Author

No systemd in CI 🛑

@kolyshkin kolyshkin closed this Feb 1, 2018
@kolyshkin kolyshkin reopened this Feb 1, 2018
@kolyshkin
Copy link
Contributor Author

kolyshkin commented Feb 1, 2018

The current idea is to have this test, but add a t.Skip() in case systemd is not available (which is the case with the current CI). If the test environment will feature systemd, the test will run.

@kolyshkin
Copy link
Contributor Author

OK, this is good to go for current CI. Still need to check if the test works in an environment with systemd.

14:18:52 --- SKIP: TestCgroupDriverSystemdMemoryLimit (0.00s)
14:18:52 	cgroupdriver_systemd_test.go:33: systemd not available

@kolyshkin
Copy link
Contributor Author

And the older failure message looked like:

13:59:35 --- FAIL: TestCgroupDriverSystemdMemoryLimit (0.88s)
13:59:35 	daemon.go:285: [d4b3033d942ed] waiting for daemon to start
13:59:35 	daemon.go:317: [d4b3033d942ed] daemon started
13:59:35 	assertions.go:226: 
                          
	Error Trace:	cgroupdriver_systemd_test.go:42
13:59:35 		
	Error:      	Received unexpected error:
13:59:35 		
	            	Error response from daemon: OCI runtime create failed: systemd cgroup flag passed, but systemd support for managing cgroups is not available: unknown
13:59:35 	daemon.go:275: [d4b3033d942ed] exiting daemon

@kolyshkin
Copy link
Contributor Author

kolyshkin commented Mar 7, 2018

Same unrelated failure on ppc and experimenal:

04:02:02 ----------------------------------------------------------------------
04:02:02 FAIL: check_test.go:366: DockerSwarmSuite.TearDownTest
04:02:02
04:02:02 unmount of /tmp/docker-execroot/d1825ad513bf4/netns failed: invalid argument
04:02:02 unmount of /tmp/docker-execroot/d1825ad513bf4/netns failed: no such file or directory
04:02:02 check_test.go:371:
04:02:02 d.Stop(c)
04:02:02 daemon/daemon.go:389:
04:02:02 t.Fatalf("Error while stopping the daemon %s : %v", d.id, err)
04:02:02 ... Error: Error while stopping the daemon d4a5ccddf48ee : exit status 130
04:02:02

I am seeing it for other PRs as well, guess some recent swarm or dockerd changes caused it.

@kolyshkin kolyshkin changed the title [do not merge] Test for systemd cgroupdriver memory setting Test for systemd cgroupdriver memory setting Mar 7, 2018
@kolyshkin
Copy link
Contributor Author

This is skipped in current CI but can be potentially usable for environment having systemd

Copy link
Member

@boaz0 boaz0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

d := daemon.New(t, "docker", "dockerd", daemon.Config{})
client, err := d.NewClient()
require.NoError(t, err)
d.StartWithBusybox(t, "--exec-opt", "native.cgroupdriver=systemd")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If using t.Parallel(), you must use --iptables=false

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching, fixed!

(detailed explanation is in commit 9e31938)

@codecov
Copy link

codecov bot commented Mar 12, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@7270b01). Click here to learn what that means.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             master   #36172   +/-   ##
=========================================
  Coverage          ?   34.87%           
=========================================
  Files             ?      612           
  Lines             ?    45801           
  Branches          ?        0           
=========================================
  Hits              ?    15973           
  Misses            ?    27759           
  Partials          ?     2069

Copy link
Member

@cpuguy83 cpuguy83 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kolyshkin
Copy link
Contributor Author

kolyshkin commented Mar 13, 2018

failure on Z is unrelated (#36547):

15:02:46 === RUN   TestServiceWithPredefinedNetwork
15:02:58 --- FAIL: TestServiceWithPredefinedNetwork (12.14s)
15:02:58 	daemon.go:283: [d71b928c0b500] waiting for daemon to start
15:02:58 	daemon.go:315: [d71b928c0b500] daemon started
15:02:58 	service_test.go:52: timeout hit after 10s: task count at 1 waiting for 0
15:02:58 	daemon.go:273: [d71b928c0b500] exiting daemon
15:02:58 FAIL

An interesting failure on powerpc:

15:21:41 === RUN   TestLinksEtcHostsContentMatch
15:21:41 --- FAIL: TestLinksEtcHostsContentMatch (0.53s)
15:21:41 	assertions.go:226: 
                          
	Error Trace:	links_linux_test.go:46
15:21:41 		
	Error:      	Not equal: 
15:21:41 		
	            	expected: "127.0.0.1\tlocalhost\n::1\tlocalhost ip6-localhost ip6-loopback\nfe00::0\tip6-localnet\nff00::0\tip6-mcastprefix\nff02::1\tip6-allnodes\nff02::2\tip6-allrouters\n172.17.0.2\tf53feb6df161\n"
15:21:41 		
	            	received: ""

Filed #36569 as a possible fix.

Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🐯

@kolyshkin
Copy link
Contributor Author

rebased (for the sake of merged fixes for unrelated test failures)

@vdemeester
Copy link
Member

@kolyshkin needs a rebase (😓)

09:06:06 integration/system/cgroupdriver_systemd_test.go:12:2: cannot find package "github.com/stretchr/testify/require" in any of:
09:06:06 	/go/src/github.com/docker/docker/vendor/github.com/stretchr/testify/require (vendor tree)
09:06:06 	/usr/local/go/src/github.com/stretchr/testify/require (from $GOROOT)
09:06:06 	/go/src/github.com/stretchr/testify/require (from $GOPATH)

This is a test case for issue moby#35123,
making sure we can set container's memory limit when using
`native.cgroupdriver=systemd`.

[v2: skip if no systemd present]
[v3: add --iptables=false to avoid flaky tests with t.Parallel()]
[v4: rebase after PR#36507 merge]

Signed-off-by: Kir Kolyshkin <[email protected]>
@kolyshkin
Copy link
Contributor Author

Unrelated failure on experimental (logs here), subject of #36611:

15:17:08 FAIL: docker_api_attach_test.go:98: DockerSuite.TestPostContainersAttach
15:17:08 
15:17:08 docker_api_attach_test.go:211:
15:17:08     c.Assert(actualStdout.Bytes(), checker.DeepEquals, []byte("hello\nsuccess"), check.Commentf("Attach didn't return the expected data from stdout"))
15:17:08 ... obtained []uint8 = []byte{0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73}
15:17:08 ... expected []uint8 = []byte{0x68, 0x65, 0x6c, 0x6c, 0x6f, 0xa, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73}
15:17:08 ... Attach didn't return the expected data from stdout

Unrelated failure on janky (logs here), subject of #34051:

16:08:14 ----------------------------------------------------------------------
16:08:14 FAIL: docker_cli_swarm_test.go:1147: DockerSwarmSuite.TestSwarmLockUnlockCluster
16:08:14 
16:08:14 [dbf4eb7502d12] waiting for daemon to start
16:08:14 [dbf4eb7502d12] daemon started
16:08:14 
16:08:14 [d4f99a4eda833] waiting for daemon to start
16:08:14 [d4f99a4eda833] daemon started
16:08:14 
16:08:14 [da5bcf1bc8b39] waiting for daemon to start
16:08:14 [da5bcf1bc8b39] daemon started
16:08:14 
16:08:14 [d4f99a4eda833] exiting daemon
16:08:14 [d4f99a4eda833] waiting for daemon to start
16:08:14 [d4f99a4eda833] daemon started
16:08:14 
16:08:14 docker_cli_swarm_test.go:1154:
16:08:14     c.Assert(getNodeStatus(c, d2), checker.Equals, swarm.LocalNodeStateActive)
16:08:14 ... obtained swarm.LocalNodeState = "pending"
16:08:14 ... expected swarm.LocalNodeState = "active"
16:08:14 
16:08:14 [dbf4eb7502d12] exiting daemon
16:08:14 [d4f99a4eda833] exiting daemon
16:08:14 [da5bcf1bc8b39] exiting daemon
16:08:28 
16:08:28 ----------------------------------------------------------------------

@thaJeztah
Copy link
Member

It's green now, flaky tests passed 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants