Skip to content

Commit

Permalink
Merge pull request moby#49017 from robmry/stable_goroutine_count
Browse files Browse the repository at this point in the history
Wait longer for a stable goroutine count in tests
  • Loading branch information
thaJeztah authored Dec 3, 2024
2 parents 97240e4 + d75394b commit efa041a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions integration-cli/docker_cli_logs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ func (s *DockerCLILogsSuite) TestLogsFollowGoroutinesWithStdout(c *testing.T) {
assert.NilError(c, d.WaitRun(id))

client := d.NewClientT(c)
nroutines := waitForStableGourtineCount(ctx, c, client)
nroutines := waitForStableGoroutineCount(ctx, c, client)

cmd := d.Command("logs", "-f", id)
r, w := io.Pipe()
Expand Down Expand Up @@ -358,7 +358,7 @@ func (s *DockerCLILogsSuite) TestLogsFollowGoroutinesNoOutput(c *testing.T) {
assert.NilError(c, d.WaitRun(id))

client := d.NewClientT(c)
nroutines := waitForStableGourtineCount(ctx, c, client)
nroutines := waitForStableGoroutineCount(ctx, c, client)
assert.NilError(c, err)

cmd := d.Command("logs", "-f", id)
Expand Down
2 changes: 1 addition & 1 deletion integration-cli/docker_cli_run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3823,7 +3823,7 @@ func (s *DockerCLIRunSuite) TestRunAttachFailedNoLeak(c *testing.T) {

client := d.NewClientT(c)

nroutines := waitForStableGourtineCount(ctx, c, client)
nroutines := waitForStableGoroutineCount(ctx, c, client)

out, err := d.Cmd(append([]string{"run", "-d", "--name=test", "-p", "8000:8000", "busybox"}, sleepCommandForDaemonPlatform()...)...)
assert.NilError(c, err, out)
Expand Down
6 changes: 3 additions & 3 deletions integration-cli/docker_utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,9 @@ func getGoroutineNumber(ctx context.Context, apiClient client.APIClient) (int, e
return info.NGoroutines, nil
}

func waitForStableGourtineCount(ctx context.Context, t poll.TestingT, apiClient client.APIClient) int {
func waitForStableGoroutineCount(ctx context.Context, t poll.TestingT, apiClient client.APIClient) int {
var out int
poll.WaitOn(t, stableGoroutineCount(ctx, apiClient, &out), poll.WithTimeout(30*time.Second))
poll.WaitOn(t, stableGoroutineCount(ctx, apiClient, &out), poll.WithDelay(time.Second), poll.WithTimeout(30*time.Second))
return out
}

Expand All @@ -374,7 +374,7 @@ func stableGoroutineCount(ctx context.Context, apiClient client.APIClient, count
nRoutines = n
}

if numStable > 3 {
if numStable > 6 {
*count = n
return poll.Success()
}
Expand Down

0 comments on commit efa041a

Please sign in to comment.