Skip to content

fix TestPidsSystemd and TestRunWithKernelMemorySystemd test error#2501

Merged
kolyshkin merged 1 commit into
opencontainers:masterfrom
XiaodongLoong:systemderror-fix
Jul 9, 2020
Merged

fix TestPidsSystemd and TestRunWithKernelMemorySystemd test error#2501
kolyshkin merged 1 commit into
opencontainers:masterfrom
XiaodongLoong:systemderror-fix

Conversation

@XiaodongLoong
Copy link
Copy Markdown
Contributor

Test command : make localunittest
Test logs:

FAIL: TestPidsSystemd (0.08s)
   utils_test.go:55: exec_test.go:630: unexpected error: container_linux.go:353: starting container process caused: process_linux.go:326: applying cgroup configuration for process caused: mountpoint for devices not found
FAIL: TestRunWithKernelMemorySystemd (0.07s)
   exec_test.go:713: runContainer failed with kernel memory limit: container_linux.go:353: starting container process caused: process_linux.go:326: applying cgroup configuration for process caused: mkdir : no such file or directory

Root cause:
TestPidsSystemd: The cgroup root path is integration/test when the test container is stating. The devices subsystem can not find under this root path, then casue apply cgroup error. The code show as following,

if name == "devices" {

TestRunWithKernelMemorySystemd: The root cause is same as the TestPidsSystemd. But it leads to mkdir "", when system want to set "KernelMemory" property. See the code as following,

if err := os.MkdirAll(path, 0755); err != nil {

Signed-off-by: Xiaodong Liu liuxiaodong@loongson.cn

@XiaodongLoong XiaodongLoong force-pushed the systemderror-fix branch 2 times, most recently from 990947e to 96f64e9 Compare July 4, 2020 06:04
@XiaodongLoong
Copy link
Copy Markdown
Contributor Author

@AkihiroSuda PTAL

}

func testPids(t *testing.T, systemd bool) {
if testing.Short() {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why remove this?

Copy link
Copy Markdown
Member

@AkihiroSuda AkihiroSuda Jul 6, 2020

Choose a reason for hiding this comment

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

Just remove -short from CentOS 7 CI

- sudo ssh default -t 'sudo -i make -C /vagrant localunittest TESTFLAGS=-short'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

TESTFLAGS=-short' let about 53 test skip. But I just solved TestPidsSystemd and _TestRunWithKernelMemorySystemd_ test cases error.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

IIUC we no longer need to skip any unit test on CentOS7 CI?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

OK, I'll have a try.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

All tests passed, 👍

@XiaodongLoong
Copy link
Copy Markdown
Contributor Author

XiaodongLoong commented Jul 6, 2020

There is an error on fedora32 (failed to update) :
make : command not found
https://travis-ci.org/github/opencontainers/runc/jobs/705364254

AkihiroSuda
AkihiroSuda previously approved these changes Jul 7, 2020
@XiaodongLoong
Copy link
Copy Markdown
Contributor Author

@kolyshkin PTAL

@kolyshkin
Copy link
Copy Markdown
Contributor

There is an error on fedora32 (failed to update) :
make : command not found
https://travis-ci.org/github/opencontainers/runc/jobs/705364254

Addressed by #2511

Comment thread .travis.yml Outdated
Comment on lines +46 to +49
# FIXME: the following unit tests are skipped (TESTFLAGS=-short):
# FAIL: TestPidsSystemd: utils_test.go:55: exec_test.go:630: unexpected error: container_linux.go:353: starting container process caused: process_linux.go:326: applying cgroup configuration for process caused: mountpoint for devices not found
# FAIL: TestRunWithKernelMemorySystemd: exec_test.go:713: runContainer failed with kernel memory limit: container_linux.go:353: starting container process caused: process_linux.go:326: applying cgroup configuration for process caused: mkdir : no such file or directory
- sudo ssh default -t 'sudo -i make -C /vagrant localunittest TESTFLAGS=-short'
- sudo ssh default -t 'sudo -i make -C /vagrant localunittest TESTFLAGS='
Copy link
Copy Markdown
Contributor

@kolyshkin kolyshkin Jul 7, 2020

Choose a reason for hiding this comment

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

So, you need to remove the FIXME comment above, as well as TESTFLAGS.

AkihiroSuda
AkihiroSuda previously approved these changes Jul 8, 2020
Signed-off-by: Xiaodong Liu <liuxiaodong@loongson.cn>
Copy link
Copy Markdown
Contributor

@kolyshkin kolyshkin 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 kolyshkin merged commit fbf047b into opencontainers:master Jul 9, 2020
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.

3 participants