Skip to content

Commit

Permalink
Merge pull request #1058 from jsturtevant/increase-windows-timout
Browse files Browse the repository at this point in the history
Increase default timeout on Windows
  • Loading branch information
k8s-ci-robot authored Jan 10, 2023
2 parents 4f5795e + aa036b5 commit 18e5983
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cmd/crictl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package main
import (
"fmt"
"os"
"runtime"
"sort"
"time"

Expand All @@ -34,6 +35,7 @@ import (
)

const defaultTimeout = 2 * time.Second
const defaultTimeoutWindows = 200 * time.Second

var (
// RuntimeEndpoint is CRI server runtime endpoint
Expand All @@ -44,7 +46,7 @@ var (
ImageEndpoint string
// ImageEndpointIsSet is true when ImageEndpoint is configured
ImageEndpointIsSet bool
// Timeout of connecting to server (default: 10s)
// Timeout of connecting to server (default: 2s on Linux, 200s on Windows)
Timeout time.Duration
// Debug enable debug output
Debug bool
Expand Down Expand Up @@ -135,6 +137,11 @@ func getTimeout(timeDuration time.Duration) time.Duration {
if timeDuration.Seconds() > 0 {
return timeDuration
}

if runtime.GOOS == "windows" {
return defaultTimeoutWindows
}

return defaultTimeout // use default
}

Expand Down

0 comments on commit 18e5983

Please sign in to comment.