mirror of https://github.com/docker/docs.git
Merge pull request #22636 from sean-jc/fix-oom-killer-tests
Add the swapMemorySupport requirement to OOM tests
This commit is contained in:
commit
95872b65fb
|
@ -8,7 +8,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func (s *DockerSuite) TestInspectOomKilledTrue(c *check.C) {
|
func (s *DockerSuite) TestInspectOomKilledTrue(c *check.C) {
|
||||||
testRequires(c, DaemonIsLinux, memoryLimitSupport)
|
testRequires(c, DaemonIsLinux, memoryLimitSupport, swapMemorySupport)
|
||||||
|
|
||||||
name := "testoomkilled"
|
name := "testoomkilled"
|
||||||
_, exitCode, _ := dockerCmdWithError("run", "--name", name, "--memory", "32MB", "busybox", "sh", "-c", "x=a; while true; do x=$x$x$x$x; done")
|
_, exitCode, _ := dockerCmdWithError("run", "--name", name, "--memory", "32MB", "busybox", "sh", "-c", "x=a; while true; do x=$x$x$x$x; done")
|
||||||
|
@ -20,7 +20,7 @@ func (s *DockerSuite) TestInspectOomKilledTrue(c *check.C) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerSuite) TestInspectOomKilledFalse(c *check.C) {
|
func (s *DockerSuite) TestInspectOomKilledFalse(c *check.C) {
|
||||||
testRequires(c, DaemonIsLinux, memoryLimitSupport)
|
testRequires(c, DaemonIsLinux, memoryLimitSupport, swapMemorySupport)
|
||||||
|
|
||||||
name := "testoomkilled"
|
name := "testoomkilled"
|
||||||
dockerCmd(c, "run", "--name", name, "--memory", "32MB", "busybox", "sh", "-c", "echo hello world")
|
dockerCmd(c, "run", "--name", name, "--memory", "32MB", "busybox", "sh", "-c", "echo hello world")
|
||||||
|
|
|
@ -554,7 +554,7 @@ func (s *DockerSuite) TestRunWithInvalidPathforBlkioDeviceWriteIOps(c *check.C)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerSuite) TestRunOOMExitCode(c *check.C) {
|
func (s *DockerSuite) TestRunOOMExitCode(c *check.C) {
|
||||||
testRequires(c, oomControl)
|
testRequires(c, memoryLimitSupport, swapMemorySupport)
|
||||||
errChan := make(chan error)
|
errChan := make(chan error)
|
||||||
go func() {
|
go func() {
|
||||||
defer close(errChan)
|
defer close(errChan)
|
||||||
|
|
|
@ -353,7 +353,8 @@ as memory limit.
|
||||||
**--memory-swap**="LIMIT"
|
**--memory-swap**="LIMIT"
|
||||||
A limit value equal to memory plus swap. Must be used with the **-m**
|
A limit value equal to memory plus swap. Must be used with the **-m**
|
||||||
(**--memory**) flag. The swap `LIMIT` should always be larger than **-m**
|
(**--memory**) flag. The swap `LIMIT` should always be larger than **-m**
|
||||||
(**--memory**) value.
|
(**--memory**) value. By default, the swap `LIMIT` will be set to double
|
||||||
|
the value of --memory.
|
||||||
|
|
||||||
The format of `LIMIT` is `<number>[<unit>]`. Unit can be `b` (bytes),
|
The format of `LIMIT` is `<number>[<unit>]`. Unit can be `b` (bytes),
|
||||||
`k` (kilobytes), `m` (megabytes), or `g` (gigabytes). If you don't specify a
|
`k` (kilobytes), `m` (megabytes), or `g` (gigabytes). If you don't specify a
|
||||||
|
|
Loading…
Reference in New Issue