-
Notifications
You must be signed in to change notification settings - Fork 950
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: add TestRunMemoryOOM test case #1552
test: add TestRunMemoryOOM test case #1552
Conversation
Thanks for your contribution. 🍻 @sunyuan3 |
Signed-off-by: Yuan Sun <[email protected]>
e48356d
to
423a021
Compare
Codecov Report
@@ Coverage Diff @@
## master #1552 +/- ##
=========================================
- Coverage 41.3% 38.81% -2.5%
=========================================
Files 267 183 -84
Lines 17331 14372 -2959
=========================================
- Hits 7159 5578 -1581
+ Misses 9282 7915 -1367
+ Partials 890 879 -11
|
cname := "TestRunMemoryOOM" | ||
ret := command.PouchRun("run", "-m", "20m", "--name", cname, busyboxImage, "sh", "-c", "x=a; while true; do x=$x$x$x$x; done") | ||
defer DelContainerForceMultyTime(c, cname) | ||
ret.Assert(c, icmd.Expected{ExitCode: 137}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we still need to use API to check whether this container is under OOM state. @sunyuan3
cc @HusterWan
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@allencloud How to check? I don't find other string to show the container is under OOM state expect return value.
#pouch inspect 038341
[
{
"Args": null,
"Created": "2018-06-20T09:00:04.906931671Z",
"ExecIDs": null,
"GraphDriver": {
"Data": {
"MergedDir": "",
"UpperDir": "/home/t4/pouch/containerd/root/io.containerd.snapshotter.v1.overlayfs/snapshots/927/fs"
},
"Name": "overlayfs"
},
"HostConfig": {
"LogConfig": {
"Type": "json-file"
},
"NetworkMode": "none",
"OomScoreAdj": -500,
"RestartPolicy": {
"Name": "no"
},
"Runtime": "runc",
"BlkioDeviceReadBps": null,
"BlkioDeviceReadIOps": null,
"BlkioDeviceWriteBps": null,
"BlkioDeviceWriteIOps": null,
"BlkioWeightDevice": null,
"CgroupParent": "default",
"DeviceCgroupRules": null,
"Devices": [],
"Memory": 4194304,
"MemoryExtra": 0,
"MemorySwappiness": -1,
"MemoryWmarkRatio": 0,
"OomKillDisable": false,
"Ulimits": null
},
"Id": "0383413d557a932dcdd006e5d731959a9dfc6f5feb6acdb50f2e36c5e03976ce",
"Image": "reg.docker.alibaba-inc.com/sunyuan/ubuntu:14.04",
"Mounts": [],
"Name": "038341",
"NetworkSettings": {
"Networks": {
"none": {
"Aliases": null,
"Links": null,
"NetworkID": "65f29c4d3becf916a635ebda8997e36e2e8acd87922c8b2466f3742563014ba1"
}
},
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null
},
"Snapshotter": {
"Data": {
"MergedDir": "",
"UpperDir": "/home/t4/pouch/containerd/root/io.containerd.snapshotter.v1.overlayfs/snapshots/927/fs"
},
"Name": "overlayfs"
},
"State": {
"ExitCode": 137,
"FinishedAt": "2018-06-20T09:01:02.354659891Z",
"Pid": -1,
"StartedAt": "2018-06-20T09:00:05.094187175Z",
"Status": "exited"
},
"Config": {
"Cmd": [
"bash",
"-c",
"x=a; while true; do x=$x$x$x$x; done"
],
"Entrypoint": null,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
],
"Image": "reg.docker.alibaba-inc.com/sunyuan/ubuntu:14.04",
"OnBuild": null,
"Shell": null
}
}
]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I discussed with @HusterWan offline. And currently we have no way to be noticed that a container is under OOM. in moby, there is event policy to tell users.
LGTM |
Signed-off-by: Yuan Sun [email protected]