INNER CODE UNIT · Go
restartTimeout
ddev/ddev · winpkg/installer_test.go:162
const restartTimeout = 10 * time.Minute
ctx, cancel := context.WithTimeout(context.Background(), restartTimeout)
defer cancel()
cmd := osexec.CommandContext(ctx, "bash", restartScript, distro)
restartOutBytes, restartErr := cmd.CombinedOutput()
restartOut := string(restartOutBytes)
t.Logf("Docker Desktop restart output:\n%s", restartOut)
if restartErr != nil {
t.Logf("Docker Desktop restart failed: %v", restartErr)
return false
}
// After restart, docker ps works but Docker Desktop may still be initializing
// its internal components. The NSIS installer exercises docker more thoroughly
// (docker info, image operations) and hangs if Docker isn't fully ready.
// Wait for docker info to succeed inside the distro as a stronger readiness check.
t.Logf("Waiting for docker info to confirm Docker is fully initialized in %s...", distro)
const dockerInfoAttempts = 12
const dockerInfoDelay = 10 * time.Second