add miniutes
parent
7fddd05bf5
commit
ef43e63e9b
|
@ -28,7 +28,6 @@ import (
|
|||
"runtime"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"k8s.io/minikube/pkg/minikube/bootstrapper/images"
|
||||
"k8s.io/minikube/pkg/minikube/config"
|
||||
|
@ -38,7 +37,7 @@ import (
|
|||
|
||||
func TestDownloadOnly(t *testing.T) {
|
||||
profile := UniqueProfileName("download")
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Minute)
|
||||
ctx, cancel := context.WithTimeout(context.Background(), Minutes(15))
|
||||
defer Cleanup(t, profile, cancel)
|
||||
|
||||
// Stores the startup run result for later error messages
|
||||
|
|
|
@ -34,6 +34,7 @@ var forceProfile = flag.String("profile", "", "force tests to run against a part
|
|||
var cleanup = flag.Bool("cleanup", true, "cleanup failed test run")
|
||||
var enableGvisor = flag.Bool("gvisor", false, "run gvisor integration test (slow)")
|
||||
var postMortemLogs = flag.Bool("postmortem-logs", true, "show logs after a failed test run")
|
||||
var slowMachine = flag.Bool("slow-machine", false, "wait longer for tests to finish")
|
||||
|
||||
// Paths to files - normally set for CI
|
||||
var binaryPath = flag.String("binary", "../../out/minikube", "path to minikube binary")
|
||||
|
@ -77,3 +78,11 @@ func ExpectedDefaultDriver() string {
|
|||
func CanCleanup() bool {
|
||||
return *cleanup
|
||||
}
|
||||
|
||||
// Minutes will return timeout in minutes based on how slow the machine is
|
||||
func Minutes(n int) time.Duration {
|
||||
if *slowMachine {
|
||||
return time.Duration(2) * time.Duration(n) * time.Minute
|
||||
}
|
||||
return time.Duration(n) * time.Minute
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue