Browse code

integration-cli: Adjust nofile limits

runc v1.3.3 needs more file descriptors now.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>

Paweł Gronowski authored on 2025/11/05 19:28:35
Showing 3 changed files
... ...
@@ -42,7 +42,7 @@ func (s *DockerCLIBuildSuite) TestBuildResourceConstraintsAreUsed(c *testing.T)
42 42
 			"--cpuset-mems=0",
43 43
 			"--cpu-shares=100",
44 44
 			"--cpu-quota=8000",
45
-			"--ulimit", "nofile=42",
45
+			"--ulimit", "nofile=50",
46 46
 			"--label="+buildLabel,
47 47
 			"-t", name, "."),
48 48
 		cli.InDir(ctx.Dir),
... ...
@@ -74,7 +74,7 @@ func (s *DockerCLIBuildSuite) TestBuildResourceConstraintsAreUsed(c *testing.T)
74 74
 	assert.Equal(c, c1.CPUShares, int64(100), "resource constraints not set properly for CPUShares")
75 75
 	assert.Equal(c, c1.CPUQuota, int64(8000), "resource constraints not set properly for CPUQuota")
76 76
 	assert.Equal(c, c1.Ulimits[0].Name, "nofile", "resource constraints not set properly for Ulimits")
77
-	assert.Equal(c, c1.Ulimits[0].Hard, int64(42), "resource constraints not set properly for Ulimits")
77
+	assert.Equal(c, c1.Ulimits[0].Hard, int64(50), "resource constraints not set properly for Ulimits")
78 78
 
79 79
 	// Make sure constraints aren't saved to image
80 80
 	cli.DockerCmd(c, "run", "--name=test", name)
... ...
@@ -393,7 +393,7 @@ func deleteInterface(t *testing.T, ifName string) {
393 393
 }
394 394
 
395 395
 func (s *DockerDaemonSuite) TestDaemonUlimitDefaults(c *testing.T) {
396
-	s.d.StartWithBusybox(testutil.GetContext(c), c, "--default-ulimit", "nofile=42:42", "--default-ulimit", "nproc=1024:1024")
396
+	s.d.StartWithBusybox(testutil.GetContext(c), c, "--default-ulimit", "nofile=50:50", "--default-ulimit", "nproc=1024:1024")
397 397
 
398 398
 	out, err := s.d.Cmd("run", "--ulimit", "nproc=2048", "--name=test", "busybox", "/bin/sh", "-c", "echo $(ulimit -n); echo $(ulimit -u)")
399 399
 	if err != nil {
... ...
@@ -407,15 +407,15 @@ func (s *DockerDaemonSuite) TestDaemonUlimitDefaults(c *testing.T) {
407 407
 	nofile := strings.TrimSpace(outArr[0])
408 408
 	nproc := strings.TrimSpace(outArr[1])
409 409
 
410
-	if nofile != "42" {
411
-		c.Fatalf("expected `ulimit -n` to be `42`, got: %s", nofile)
410
+	if nofile != "50" {
411
+		c.Fatalf("expected `ulimit -n` to be `50`, got: %s", nofile)
412 412
 	}
413 413
 	if nproc != "2048" {
414 414
 		c.Fatalf("expected `ulimit -u` to be 2048, got: %s", nproc)
415 415
 	}
416 416
 
417 417
 	// Now restart daemon with a new default
418
-	s.d.Restart(c, "--default-ulimit", "nofile=43")
418
+	s.d.Restart(c, "--default-ulimit", "nofile=50")
419 419
 
420 420
 	out, err = s.d.Cmd("start", "-a", "test")
421 421
 	if err != nil {
... ...
@@ -429,8 +429,8 @@ func (s *DockerDaemonSuite) TestDaemonUlimitDefaults(c *testing.T) {
429 429
 	nofile = strings.TrimSpace(outArr[0])
430 430
 	nproc = strings.TrimSpace(outArr[1])
431 431
 
432
-	if nofile != "43" {
433
-		c.Fatalf("expected `ulimit -n` to be `43`, got: %s", nofile)
432
+	if nofile != "50" {
433
+		c.Fatalf("expected `ulimit -n` to be `50`, got: %s", nofile)
434 434
 	}
435 435
 	if nproc != "2048" {
436 436
 		c.Fatalf("expected `ulimit -u` to be 2048, got: %s", nproc)
... ...
@@ -3114,10 +3114,10 @@ func (s *DockerCLIRunSuite) TestRunWithUlimits(c *testing.T) {
3114 3114
 	// Not applicable on Windows as uses Unix specific functionality
3115 3115
 	testRequires(c, DaemonIsLinux)
3116 3116
 
3117
-	out := cli.DockerCmd(c, "run", "--name=testulimits", "--ulimit", "nofile=42", "busybox", "/bin/sh", "-c", "ulimit -n").Combined()
3117
+	out := cli.DockerCmd(c, "run", "--name=testulimits", "--ulimit", "nofile=50", "busybox", "/bin/sh", "-c", "ulimit -n").Combined()
3118 3118
 	ul := strings.TrimSpace(out)
3119
-	if ul != "42" {
3120
-		c.Fatalf("expected `ulimit -n` to be 42, got %s", ul)
3119
+	if ul != "50" {
3120
+		c.Fatalf("expected `ulimit -n` to be 50, got %s", ul)
3121 3121
 	}
3122 3122
 }
3123 3123
 
... ...
@@ -3939,13 +3939,13 @@ func (s *DockerDaemonSuite) TestRunWithUlimitAndDaemonDefault(c *testing.T) {
3939 3939
 	assert.NilError(c, err)
3940 3940
 	assert.Assert(c, is.Contains(out, "[nofile=65535:65535]"))
3941 3941
 	name = "test-B"
3942
-	_, err = d.Cmd("run", "--name", name, "--ulimit=nofile=42", "-d", "busybox", "top")
3942
+	_, err = d.Cmd("run", "--name", name, "--ulimit=nofile=50", "-d", "busybox", "top")
3943 3943
 	assert.NilError(c, err)
3944 3944
 	assert.NilError(c, d.WaitRun(name))
3945 3945
 
3946 3946
 	out, err = d.Cmd("inspect", "--format", "{{.HostConfig.Ulimits}}", name)
3947 3947
 	assert.NilError(c, err)
3948
-	assert.Assert(c, is.Contains(out, "[nofile=42:42]"))
3948
+	assert.Assert(c, is.Contains(out, "[nofile=50:50]"))
3949 3949
 }
3950 3950
 
3951 3951
 func (s *DockerCLIRunSuite) TestRunStoppedLoggingDriverNoLeak(c *testing.T) {