mirror of
https://github.com/moby/moby.git
synced 2025-07-30 18:23:29 +03:00
Merge pull request #41168 from thaJeztah/raise_minimum_memory_limit
Set minimum memory limit to 6M, to account for higher startup memory use
This commit is contained in:
@ -2826,13 +2826,11 @@ func (s *DockerSuite) TestRunPIDHostWithChildIsKillable(c *testing.T) {
|
||||
}
|
||||
|
||||
func (s *DockerSuite) TestRunWithTooSmallMemoryLimit(c *testing.T) {
|
||||
// TODO Windows. This may be possible to enable once Windows supports
|
||||
// memory limits on containers
|
||||
// TODO Windows. This may be possible to enable once Windows supports memory limits on containers
|
||||
testRequires(c, DaemonIsLinux)
|
||||
// this memory limit is 1 byte less than the min, which is 4MB
|
||||
// https://github.com/docker/docker/blob/v1.5.0/daemon/create.go#L22
|
||||
out, _, err := dockerCmdWithError("run", "-m", "4194303", "busybox")
|
||||
if err == nil || !strings.Contains(out, "Minimum memory limit allowed is 4MB") {
|
||||
// this memory limit is 1 byte less than the min (daemon.linuxMinMemory), which is 6MB (6291456 bytes)
|
||||
out, _, err := dockerCmdWithError("create", "-m", "6291455", "busybox")
|
||||
if err == nil || !strings.Contains(out, "Minimum memory limit allowed is 6MB") {
|
||||
c.Fatalf("expected run to fail when using too low a memory limit: %q", out)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user