Merge pull request #6723 from medyagh/gh_timeout
add new flag for e2e tests to increase timeoutpull/6741/head
commit
80c4f81d94
|
@ -94,7 +94,7 @@ jobs:
|
|||
chmod a+x e2e-*
|
||||
chmod a+x minikube-*
|
||||
START_TIME=$(date -u +%s)
|
||||
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-linux-amd64 -minikube-start-args=--vm-driver=docker -expected-default-driver= -test.timeout=70m -test.v -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
|
||||
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-linux-amd64 -minikube-start-args=--vm-driver=docker -test.timeout=70m -test.v -timeout-multiplier=3 -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
|
||||
END_TIME=$(date -u +%s)
|
||||
TIME_ELAPSED=$(($END_TIME-$START_TIME))
|
||||
min=$((${TIME_ELAPSED}/60))
|
||||
|
@ -156,7 +156,7 @@ jobs:
|
|||
chmod a+x e2e-*
|
||||
chmod a+x minikube-*
|
||||
START_TIME=$(date -u +%s)
|
||||
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-linux-amd64 -minikube-start-args=--vm-driver=docker -expected-default-driver= -test.timeout=70m -test.v -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
|
||||
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-linux-amd64 -minikube-start-args=--vm-driver=docker -test.timeout=70m -test.v -timeout-multiplier=3 -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
|
||||
END_TIME=$(date -u +%s)
|
||||
TIME_ELAPSED=$(($END_TIME-$START_TIME))
|
||||
min=$((${TIME_ELAPSED}/60))
|
||||
|
@ -218,7 +218,7 @@ jobs:
|
|||
chmod a+x e2e-*
|
||||
chmod a+x minikube-*
|
||||
START_TIME=$(date -u +%s)
|
||||
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-linux-amd64 -minikube-start-args=--vm-driver=docker -expected-default-driver= -test.timeout=70m -test.v -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
|
||||
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome sudo -E ./e2e-linux-amd64 -minikube-start-args=--vm-driver=none -test.timeout=70m -test.v -timeout-multiplier=3 -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
|
||||
END_TIME=$(date -u +%s)
|
||||
TIME_ELAPSED=$(($END_TIME-$START_TIME))
|
||||
min=$((${TIME_ELAPSED}/60))
|
||||
|
@ -280,7 +280,7 @@ jobs:
|
|||
chmod a+x e2e-*
|
||||
chmod a+x minikube-*
|
||||
START_TIME=$(date -u +%s)
|
||||
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-linux-amd64 -minikube-start-args=--vm-driver=docker -expected-default-driver= -test.timeout=70m -test.v -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
|
||||
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome sudo -E ./e2e-linux-amd64 -minikube-start-args=--vm-driver=none -test.timeout=70m -test.v -timeout-multiplier=3 -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
|
||||
END_TIME=$(date -u +%s)
|
||||
TIME_ELAPSED=$(($END_TIME-$START_TIME))
|
||||
min=$((${TIME_ELAPSED}/60))
|
||||
|
@ -353,7 +353,7 @@ jobs:
|
|||
chmod a+x e2e-*
|
||||
chmod a+x minikube-*
|
||||
START_TIME=$(date -u +%s)
|
||||
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome ./e2e-linux-amd64 -minikube-start-args=--vm-driver=docker -expected-default-driver= -test.timeout=70m -test.v -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
|
||||
KUBECONFIG=$(pwd)/testhome/kubeconfig MINIKUBE_HOME=$(pwd)/testhome sudo -E ./e2e-linux-amd64 -minikube-start-args=--vm-driver=podman -test.timeout=70m -test.v -timeout-multiplier=3 -binary=./minikube-linux-amd64 2>&1 | tee ./report/testout.txt
|
||||
END_TIME=$(date -u +%s)
|
||||
TIME_ELAPSED=$(($END_TIME-$START_TIME))
|
||||
min=$((${TIME_ELAPSED}/60))
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -24,7 +24,6 @@ import (
|
|||
"os"
|
||||
"os/exec"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestOffline(t *testing.T) {
|
||||
|
@ -39,7 +38,7 @@ func TestOffline(t *testing.T) {
|
|||
}
|
||||
|
||||
profile := UniqueProfileName(fmt.Sprintf("offline-%s", runtime))
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Minute)
|
||||
ctx, cancel := context.WithTimeout(context.Background(), Minutes(15))
|
||||
defer CleanupWithLogs(t, profile, cancel)
|
||||
|
||||
startArgs := []string{"start", "-p", profile, "--alsologtostderr", "-v=1", "--wait=true", "--container-runtime", runtime}
|
||||
|
|
|
@ -37,7 +37,7 @@ import (
|
|||
// TestAddons tests addons that require no special environment -- in parallel
|
||||
func TestAddons(t *testing.T) {
|
||||
profile := UniqueProfileName("addons")
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 40*time.Minute)
|
||||
ctx, cancel := context.WithTimeout(context.Background(), Minutes(40))
|
||||
defer CleanupWithLogs(t, profile, cancel)
|
||||
|
||||
args := append([]string{"start", "-p", profile, "--wait=false", "--memory=2600", "--alsologtostderr", "-v=1", "--addons=ingress", "--addons=registry", "--addons=metrics-server"}, StartArgs()...)
|
||||
|
@ -90,10 +90,10 @@ func validateIngressAddon(ctx context.Context, t *testing.T, profile string) {
|
|||
t.Fatalf("kubernetes client: %v", client)
|
||||
}
|
||||
|
||||
if err := kapi.WaitForDeploymentToStabilize(client, "kube-system", "nginx-ingress-controller", 6*time.Minute); err != nil {
|
||||
if err := kapi.WaitForDeploymentToStabilize(client, "kube-system", "nginx-ingress-controller", Minutes(6)); err != nil {
|
||||
t.Errorf("waiting for ingress-controller deployment to stabilize: %v", err)
|
||||
}
|
||||
if _, err := PodWait(ctx, t, profile, "kube-system", "app.kubernetes.io/name=nginx-ingress-controller", 12*time.Minute); err != nil {
|
||||
if _, err := PodWait(ctx, t, profile, "kube-system", "app.kubernetes.io/name=nginx-ingress-controller", Minutes(12)); err != nil {
|
||||
t.Fatalf("wait: %v", err)
|
||||
}
|
||||
|
||||
|
@ -106,10 +106,10 @@ func validateIngressAddon(ctx context.Context, t *testing.T, profile string) {
|
|||
t.Errorf("%s failed: %v", rr.Args, err)
|
||||
}
|
||||
|
||||
if _, err := PodWait(ctx, t, profile, "default", "run=nginx", 4*time.Minute); err != nil {
|
||||
if _, err := PodWait(ctx, t, profile, "default", "run=nginx", Minutes(4)); err != nil {
|
||||
t.Fatalf("wait: %v", err)
|
||||
}
|
||||
if err := kapi.WaitForService(client, "default", "nginx", true, time.Millisecond*500, time.Minute*10); err != nil {
|
||||
if err := kapi.WaitForService(client, "default", "nginx", true, time.Millisecond*500, Minutes(10)); err != nil {
|
||||
t.Errorf("Error waiting for nginx service to be up")
|
||||
}
|
||||
|
||||
|
@ -128,7 +128,7 @@ func validateIngressAddon(ctx context.Context, t *testing.T, profile string) {
|
|||
return nil
|
||||
}
|
||||
|
||||
if err := retry.Expo(checkIngress, 500*time.Millisecond, time.Minute); err != nil {
|
||||
if err := retry.Expo(checkIngress, 500*time.Millisecond, Minutes(1)); err != nil {
|
||||
t.Errorf("ingress never responded as expected on 127.0.0.1:80: %v", err)
|
||||
}
|
||||
|
||||
|
@ -145,15 +145,15 @@ func validateRegistryAddon(ctx context.Context, t *testing.T, profile string) {
|
|||
}
|
||||
|
||||
start := time.Now()
|
||||
if err := kapi.WaitForRCToStabilize(client, "kube-system", "registry", 6*time.Minute); err != nil {
|
||||
if err := kapi.WaitForRCToStabilize(client, "kube-system", "registry", Minutes(6)); err != nil {
|
||||
t.Errorf("waiting for registry replicacontroller to stabilize: %v", err)
|
||||
}
|
||||
t.Logf("registry stabilized in %s", time.Since(start))
|
||||
|
||||
if _, err := PodWait(ctx, t, profile, "kube-system", "actual-registry=true", 6*time.Minute); err != nil {
|
||||
if _, err := PodWait(ctx, t, profile, "kube-system", "actual-registry=true", Minutes(6)); err != nil {
|
||||
t.Fatalf("wait: %v", err)
|
||||
}
|
||||
if _, err := PodWait(ctx, t, profile, "kube-system", "registry-proxy=true", 10*time.Minute); err != nil {
|
||||
if _, err := PodWait(ctx, t, profile, "kube-system", "registry-proxy=true", Minutes(10)); err != nil {
|
||||
t.Fatalf("wait: %v", err)
|
||||
}
|
||||
|
||||
|
@ -198,7 +198,7 @@ func validateRegistryAddon(ctx context.Context, t *testing.T, profile string) {
|
|||
return nil
|
||||
}
|
||||
|
||||
if err := retry.Expo(checkExternalAccess, 500*time.Millisecond, 2*time.Minute); err != nil {
|
||||
if err := retry.Expo(checkExternalAccess, 500*time.Millisecond, Minutes(2)); err != nil {
|
||||
t.Errorf(err.Error())
|
||||
}
|
||||
|
||||
|
@ -215,12 +215,12 @@ func validateMetricsServerAddon(ctx context.Context, t *testing.T, profile strin
|
|||
}
|
||||
|
||||
start := time.Now()
|
||||
if err := kapi.WaitForDeploymentToStabilize(client, "kube-system", "metrics-server", 6*time.Minute); err != nil {
|
||||
if err := kapi.WaitForDeploymentToStabilize(client, "kube-system", "metrics-server", Minutes(6)); err != nil {
|
||||
t.Errorf("waiting for metrics-server deployment to stabilize: %v", err)
|
||||
}
|
||||
t.Logf("metrics-server stabilized in %s", time.Since(start))
|
||||
|
||||
if _, err := PodWait(ctx, t, profile, "kube-system", "k8s-app=metrics-server", 6*time.Minute); err != nil {
|
||||
if _, err := PodWait(ctx, t, profile, "kube-system", "k8s-app=metrics-server", Minutes(6)); err != nil {
|
||||
t.Fatalf("wait: %v", err)
|
||||
}
|
||||
|
||||
|
@ -240,7 +240,7 @@ func validateMetricsServerAddon(ctx context.Context, t *testing.T, profile strin
|
|||
}
|
||||
|
||||
// metrics-server takes some time to be able to collect metrics
|
||||
if err := retry.Expo(checkMetricsServer, time.Minute, 5*time.Minute); err != nil {
|
||||
if err := retry.Expo(checkMetricsServer, Seconds(13), Minutes(6)); err != nil {
|
||||
t.Errorf(err.Error())
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,6 @@ import (
|
|||
"os/exec"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestDockerFlags(t *testing.T) {
|
||||
|
@ -33,7 +32,7 @@ func TestDockerFlags(t *testing.T) {
|
|||
MaybeParallel(t)
|
||||
|
||||
profile := UniqueProfileName("docker-flags")
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Minute)
|
||||
ctx, cancel := context.WithTimeout(context.Background(), Minutes(30))
|
||||
defer CleanupWithLogs(t, profile, cancel)
|
||||
|
||||
// Use the most verbose logging for the simplest test. If it fails, something is very wrong.
|
||||
|
|
|
@ -56,7 +56,7 @@ func validateMountCmd(ctx context.Context, t *testing.T, profile string) {
|
|||
t.Fatalf("Unexpected error while creating tempDir: %v", err)
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithTimeout(ctx, 10*time.Minute)
|
||||
ctx, cancel := context.WithTimeout(ctx, Minutes(10))
|
||||
|
||||
args := []string{"mount", "-p", profile, fmt.Sprintf("%s:%s", tempDir, guestMount), "--alsologtostderr", "-v=1"}
|
||||
ss, err := Start(t, exec.CommandContext(ctx, Target(), args...))
|
||||
|
@ -139,7 +139,7 @@ func validateMountCmd(ctx context.Context, t *testing.T, profile string) {
|
|||
t.Fatalf("%s failed: %v", rr.Args, err)
|
||||
}
|
||||
|
||||
if _, err := PodWait(ctx, t, profile, "default", "integration-test=busybox-mount", 4*time.Minute); err != nil {
|
||||
if _, err := PodWait(ctx, t, profile, "default", "integration-test=busybox-mount", Minutes(4)); err != nil {
|
||||
t.Fatalf("wait: %v", err)
|
||||
}
|
||||
|
||||
|
|
|
@ -34,10 +34,10 @@ import (
|
|||
)
|
||||
|
||||
func validatePersistentVolumeClaim(ctx context.Context, t *testing.T, profile string) {
|
||||
ctx, cancel := context.WithTimeout(ctx, 10*time.Minute)
|
||||
ctx, cancel := context.WithTimeout(ctx, Minutes(10))
|
||||
defer cancel()
|
||||
|
||||
if _, err := PodWait(ctx, t, profile, "kube-system", "integration-test=storage-provisioner", 4*time.Minute); err != nil {
|
||||
if _, err := PodWait(ctx, t, profile, "kube-system", "integration-test=storage-provisioner", Minutes(4)); err != nil {
|
||||
t.Fatalf("wait: %v", err)
|
||||
}
|
||||
|
||||
|
@ -83,7 +83,7 @@ func validatePersistentVolumeClaim(ctx context.Context, t *testing.T, profile st
|
|||
return fmt.Errorf("testpvc phase = %q, want %q (msg=%+v)", pvc.Status.Phase, "Bound", pvc)
|
||||
}
|
||||
|
||||
if err := retry.Expo(checkStoragePhase, 2*time.Second, 4*time.Minute); err != nil {
|
||||
if err := retry.Expo(checkStoragePhase, 2*time.Second, Minutes(4)); err != nil {
|
||||
t.Fatalf("PV Creation failed with error: %v", err)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ import (
|
|||
)
|
||||
|
||||
func validateTunnelCmd(ctx context.Context, t *testing.T, profile string) {
|
||||
ctx, cancel := context.WithTimeout(ctx, 20*time.Minute)
|
||||
ctx, cancel := context.WithTimeout(ctx, Minutes(20))
|
||||
defer cancel()
|
||||
|
||||
if runtime.GOOS != "windows" {
|
||||
|
@ -71,17 +71,17 @@ func validateTunnelCmd(ctx context.Context, t *testing.T, profile string) {
|
|||
if err != nil {
|
||||
t.Fatalf("%s failed: %v", rr.Args, err)
|
||||
}
|
||||
if _, err := PodWait(ctx, t, profile, "default", "run=nginx-svc", 4*time.Minute); err != nil {
|
||||
if _, err := PodWait(ctx, t, profile, "default", "run=nginx-svc", Minutes(4)); err != nil {
|
||||
t.Fatalf("wait: %v", err)
|
||||
}
|
||||
|
||||
if err := kapi.WaitForService(client, "default", "nginx-svc", true, 1*time.Second, 2*time.Minute); err != nil {
|
||||
if err := kapi.WaitForService(client, "default", "nginx-svc", true, 1*time.Second, Minutes(2)); err != nil {
|
||||
t.Fatal(errors.Wrap(err, "Error waiting for nginx service to be up"))
|
||||
}
|
||||
|
||||
// Wait until the nginx-svc has a loadbalancer ingress IP
|
||||
nginxIP := ""
|
||||
err = wait.PollImmediate(1*time.Second, 3*time.Minute, func() (bool, error) {
|
||||
err = wait.PollImmediate(1*time.Second, Minutes(3), func() (bool, error) {
|
||||
rr, err := Run(t, exec.CommandContext(ctx, "kubectl", "--context", profile, "get", "svc", "nginx-svc", "-o", "jsonpath={.status.loadBalancer.ingress[0].ip}"))
|
||||
if err != nil {
|
||||
return false, err
|
||||
|
@ -119,7 +119,7 @@ func validateTunnelCmd(ctx context.Context, t *testing.T, profile string) {
|
|||
}
|
||||
return nil
|
||||
}
|
||||
if err = retry.Expo(fetch, time.Millisecond*500, 2*time.Minute, 6); err != nil {
|
||||
if err = retry.Expo(fetch, time.Millisecond*500, Minutes(2), 6); err != nil {
|
||||
t.Errorf("failed to contact nginx at %s: %v", nginxIP, err)
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ type validateFunc func(context.Context, *testing.T, string)
|
|||
func TestFunctional(t *testing.T) {
|
||||
|
||||
profile := UniqueProfileName("functional")
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 40*time.Minute)
|
||||
ctx, cancel := context.WithTimeout(context.Background(), Minutes(40))
|
||||
defer func() {
|
||||
p := localSyncTestPath()
|
||||
if err := os.Remove(p); err != nil {
|
||||
|
@ -125,7 +125,7 @@ func TestFunctional(t *testing.T) {
|
|||
|
||||
// check functionality of minikube after evaling docker-env
|
||||
func validateDockerEnv(ctx context.Context, t *testing.T, profile string) {
|
||||
mctx, cancel := context.WithTimeout(ctx, 13*time.Second)
|
||||
mctx, cancel := context.WithTimeout(ctx, Seconds(13))
|
||||
defer cancel()
|
||||
// we should be able to get minikube status with a bash which evaled docker-env
|
||||
c := exec.CommandContext(mctx, "/bin/bash", "-c", "eval $("+Target()+" -p "+profile+" docker-env) && "+Target()+" status -p "+profile)
|
||||
|
@ -137,7 +137,7 @@ func validateDockerEnv(ctx context.Context, t *testing.T, profile string) {
|
|||
t.Fatalf("Expected status output to include 'Running' after eval docker-env but got \n%s", rr.Output())
|
||||
}
|
||||
|
||||
mctx, cancel = context.WithTimeout(ctx, 13*time.Second)
|
||||
mctx, cancel = context.WithTimeout(ctx, Seconds(13))
|
||||
defer cancel()
|
||||
// do a eval $(minikube -p profile docker-env) and check if we are point to docker inside minikube
|
||||
c = exec.CommandContext(mctx, "/bin/bash", "-c", "eval $("+Target()+" -p "+profile+" docker-env) && docker images")
|
||||
|
@ -294,7 +294,7 @@ func validateDashboardCmd(ctx context.Context, t *testing.T, profile string) {
|
|||
}()
|
||||
|
||||
start := time.Now()
|
||||
s, err := ReadLineWithTimeout(ss.Stdout, 300*time.Second)
|
||||
s, err := ReadLineWithTimeout(ss.Stdout, Seconds(300))
|
||||
if err != nil {
|
||||
if runtime.GOOS == "windows" {
|
||||
t.Skipf("failed to read url within %s: %v\noutput: %q\n", time.Since(start), err, s)
|
||||
|
@ -327,7 +327,7 @@ func validateDNS(ctx context.Context, t *testing.T, profile string) {
|
|||
t.Fatalf("%s failed: %v", rr.Args, err)
|
||||
}
|
||||
|
||||
names, err := PodWait(ctx, t, profile, "default", "integration-test=busybox", 5*time.Minute)
|
||||
names, err := PodWait(ctx, t, profile, "default", "integration-test=busybox", Minutes(4))
|
||||
if err != nil {
|
||||
t.Fatalf("wait: %v", err)
|
||||
}
|
||||
|
@ -338,7 +338,7 @@ func validateDNS(ctx context.Context, t *testing.T, profile string) {
|
|||
}
|
||||
|
||||
// If the coredns process was stable, this retry wouldn't be necessary.
|
||||
if err = retry.Expo(nslookup, 1*time.Second, 1*time.Minute); err != nil {
|
||||
if err = retry.Expo(nslookup, 1*time.Second, Minutes(1)); err != nil {
|
||||
t.Errorf("nslookup failing: %v", err)
|
||||
}
|
||||
|
||||
|
@ -351,7 +351,7 @@ func validateDNS(ctx context.Context, t *testing.T, profile string) {
|
|||
// validateDryRun asserts that the dry-run mode quickly exits with the right code
|
||||
func validateDryRun(ctx context.Context, t *testing.T, profile string) {
|
||||
// dry-run mode should always be able to finish quickly (<5s)
|
||||
mctx, cancel := context.WithTimeout(ctx, 5*time.Second)
|
||||
mctx, cancel := context.WithTimeout(ctx, Seconds(5))
|
||||
defer cancel()
|
||||
|
||||
// Too little memory!
|
||||
|
@ -364,7 +364,7 @@ func validateDryRun(ctx context.Context, t *testing.T, profile string) {
|
|||
t.Errorf("dry-run(250MB) exit code = %d, wanted = %d: %v", rr.ExitCode, wantCode, err)
|
||||
}
|
||||
|
||||
dctx, cancel := context.WithTimeout(ctx, 5*time.Second)
|
||||
dctx, cancel := context.WithTimeout(ctx, Seconds(5))
|
||||
defer cancel()
|
||||
startArgs = append([]string{"start", "-p", profile, "--dry-run", "--alsologtostderr", "-v=1"}, StartArgs()...)
|
||||
c = exec.CommandContext(dctx, Target(), startArgs...)
|
||||
|
@ -580,7 +580,7 @@ func validateServiceCmd(ctx context.Context, t *testing.T, profile string) {
|
|||
t.Logf("%s failed: %v (may not be an error)", rr.Args, err)
|
||||
}
|
||||
|
||||
if _, err := PodWait(ctx, t, profile, "default", "app=hello-node", 10*time.Minute); err != nil {
|
||||
if _, err := PodWait(ctx, t, profile, "default", "app=hello-node", Minutes(10)); err != nil {
|
||||
t.Fatalf("wait: %v", err)
|
||||
}
|
||||
|
||||
|
@ -691,7 +691,7 @@ func validateMySQL(ctx context.Context, t *testing.T, profile string) {
|
|||
t.Fatalf("%s failed: %v", rr.Args, err)
|
||||
}
|
||||
|
||||
names, err := PodWait(ctx, t, profile, "default", "app=mysql", 10*time.Minute)
|
||||
names, err := PodWait(ctx, t, profile, "default", "app=mysql", Minutes(10))
|
||||
if err != nil {
|
||||
t.Fatalf("podwait: %v", err)
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@ import (
|
|||
"fmt"
|
||||
"os/exec"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"k8s.io/minikube/pkg/minikube/vmpath"
|
||||
)
|
||||
|
@ -32,7 +31,7 @@ func TestGuestEnvironment(t *testing.T) {
|
|||
MaybeParallel(t)
|
||||
|
||||
profile := UniqueProfileName("guest")
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Minute)
|
||||
ctx, cancel := context.WithTimeout(context.Background(), Minutes(15))
|
||||
defer CleanupWithLogs(t, profile, cancel)
|
||||
|
||||
args := append([]string{"start", "-p", profile, "--install-addons=false", "--wait=false"}, StartArgs()...)
|
||||
|
|
|
@ -23,7 +23,6 @@ import (
|
|||
"os/exec"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestGvisorAddon(t *testing.T) {
|
||||
|
@ -36,7 +35,7 @@ func TestGvisorAddon(t *testing.T) {
|
|||
|
||||
MaybeParallel(t)
|
||||
profile := UniqueProfileName("gvisor")
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 60*time.Minute)
|
||||
ctx, cancel := context.WithTimeout(context.Background(), Minutes(60))
|
||||
defer func() {
|
||||
if t.Failed() {
|
||||
rr, err := Run(t, exec.CommandContext(ctx, "kubectl", "--context", profile, "logs", "gvisor", "-n", "kube-system"))
|
||||
|
@ -65,7 +64,7 @@ func TestGvisorAddon(t *testing.T) {
|
|||
t.Fatalf("%s failed: %v", rr.Args, err)
|
||||
}
|
||||
|
||||
if _, err := PodWait(ctx, t, profile, "kube-system", "kubernetes.io/minikube-addons=gvisor", 4*time.Minute); err != nil {
|
||||
if _, err := PodWait(ctx, t, profile, "kube-system", "kubernetes.io/minikube-addons=gvisor", Minutes(4)); err != nil {
|
||||
t.Fatalf("waiting for gvisor controller to be up: %v", err)
|
||||
}
|
||||
|
||||
|
@ -80,10 +79,10 @@ func TestGvisorAddon(t *testing.T) {
|
|||
t.Fatalf("%s failed: %v", rr.Args, err)
|
||||
}
|
||||
|
||||
if _, err := PodWait(ctx, t, profile, "default", "run=nginx,untrusted=true", 4*time.Minute); err != nil {
|
||||
if _, err := PodWait(ctx, t, profile, "default", "run=nginx,untrusted=true", Minutes(4)); err != nil {
|
||||
t.Errorf("nginx: %v", err)
|
||||
}
|
||||
if _, err := PodWait(ctx, t, profile, "default", "run=nginx,runtime=gvisor", 4*time.Minute); err != nil {
|
||||
if _, err := PodWait(ctx, t, profile, "default", "run=nginx,runtime=gvisor", Minutes(4)); err != nil {
|
||||
t.Errorf("nginx: %v", err)
|
||||
}
|
||||
|
||||
|
@ -97,13 +96,13 @@ func TestGvisorAddon(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatalf("%s failed: %v", rr.Args, err)
|
||||
}
|
||||
if _, err := PodWait(ctx, t, profile, "kube-system", "kubernetes.io/minikube-addons=gvisor", 4*time.Minute); err != nil {
|
||||
if _, err := PodWait(ctx, t, profile, "kube-system", "kubernetes.io/minikube-addons=gvisor", Minutes(4)); err != nil {
|
||||
t.Errorf("waiting for gvisor controller to be up: %v", err)
|
||||
}
|
||||
if _, err := PodWait(ctx, t, profile, "default", "run=nginx,untrusted=true", 4*time.Minute); err != nil {
|
||||
if _, err := PodWait(ctx, t, profile, "default", "run=nginx,untrusted=true", Minutes(4)); err != nil {
|
||||
t.Errorf("nginx: %v", err)
|
||||
}
|
||||
if _, err := PodWait(ctx, t, profile, "default", "run=nginx,runtime=gvisor", 4*time.Minute); err != nil {
|
||||
if _, err := PodWait(ctx, t, profile, "default", "run=nginx,runtime=gvisor", Minutes(4)); err != nil {
|
||||
t.Errorf("nginx: %v", err)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 timeOutMultiplier = flag.Float64("timeout-multiplier", 1, "multiply the timeout for the tests")
|
||||
|
||||
// Paths to files - normally set for CI
|
||||
var binaryPath = flag.String("binary", "../../out/minikube", "path to minikube binary")
|
||||
|
@ -77,3 +78,13 @@ 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 {
|
||||
return time.Duration(*timeOutMultiplier) * time.Duration(n) * time.Minute
|
||||
}
|
||||
|
||||
// Seconds will return timeout in minutes based on how slow the machine is
|
||||
func Seconds(n int) time.Duration {
|
||||
return time.Duration(*timeOutMultiplier) * time.Duration(n) * time.Second
|
||||
}
|
||||
|
|
|
@ -28,7 +28,6 @@ import (
|
|||
"strconv"
|
||||
"syscall"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"k8s.io/minikube/pkg/minikube/localpath"
|
||||
)
|
||||
|
@ -41,7 +40,7 @@ func TestChangeNoneUser(t *testing.T) {
|
|||
MaybeParallel(t)
|
||||
|
||||
profile := UniqueProfileName("none")
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
|
||||
ctx, cancel := context.WithTimeout(context.Background(), Minutes(10))
|
||||
defer CleanupWithLogs(t, profile, cancel)
|
||||
|
||||
startArgs := append([]string{"CHANGE_MINIKUBE_NONE_USER=true", Target(), "start", "--wait=false"}, StartArgs()...)
|
||||
|
|
|
@ -28,7 +28,6 @@ import (
|
|||
"strconv"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/docker/machine/libmachine/state"
|
||||
"github.com/google/go-cmp/cmp"
|
||||
|
@ -84,7 +83,7 @@ func TestStartStop(t *testing.T) {
|
|||
}
|
||||
|
||||
profile := UniqueProfileName(tc.name)
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 40*time.Minute)
|
||||
ctx, cancel := context.WithTimeout(context.Background(), Minutes(40))
|
||||
defer CleanupWithLogs(t, profile, cancel)
|
||||
|
||||
startArgs := append([]string{"start", "-p", profile, "--alsologtostderr", "-v=3", "--wait=true"}, tc.args...)
|
||||
|
@ -128,10 +127,10 @@ func TestStartStop(t *testing.T) {
|
|||
if strings.Contains(tc.name, "cni") {
|
||||
t.Logf("WARNING: cni mode requires additional setup before pods can schedule :(")
|
||||
} else {
|
||||
if _, err := PodWait(ctx, t, profile, "default", "integration-test=busybox", 4*time.Minute); err != nil {
|
||||
if _, err := PodWait(ctx, t, profile, "default", "integration-test=busybox", Minutes(4)); err != nil {
|
||||
t.Fatalf("post-stop-start pod wait: %v", err)
|
||||
}
|
||||
if _, err := PodWait(ctx, t, profile, "kubernetes-dashboard", "k8s-app=kubernetes-dashboard", 4*time.Minute); err != nil {
|
||||
if _, err := PodWait(ctx, t, profile, "kubernetes-dashboard", "k8s-app=kubernetes-dashboard", Minutes(4)); err != nil {
|
||||
t.Fatalf("post-stop-start addon wait: %v", err)
|
||||
}
|
||||
}
|
||||
|
@ -178,7 +177,7 @@ func testPodScheduling(ctx context.Context, t *testing.T, profile string) {
|
|||
}
|
||||
|
||||
// 8 minutes, because 4 is not enough for images to pull in all cases.
|
||||
names, err := PodWait(ctx, t, profile, "default", "integration-test=busybox", 8*time.Minute)
|
||||
names, err := PodWait(ctx, t, profile, "default", "integration-test=busybox", Minutes(8))
|
||||
if err != nil {
|
||||
t.Fatalf("wait: %v", err)
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ import (
|
|||
func TestVersionUpgrade(t *testing.T) {
|
||||
MaybeParallel(t)
|
||||
profile := UniqueProfileName("vupgrade")
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 55*time.Minute)
|
||||
ctx, cancel := context.WithTimeout(context.Background(), Minutes(55))
|
||||
|
||||
defer CleanupWithLogs(t, profile, cancel)
|
||||
|
||||
|
@ -55,7 +55,7 @@ func TestVersionUpgrade(t *testing.T) {
|
|||
tf.Close()
|
||||
|
||||
url := pkgutil.GetBinaryDownloadURL("latest", runtime.GOOS)
|
||||
if err := retry.Expo(func() error { return getter.GetFile(tf.Name(), url) }, 3*time.Second, 3*time.Minute); err != nil {
|
||||
if err := retry.Expo(func() error { return getter.GetFile(tf.Name(), url) }, 3*time.Second, Minutes(3)); err != nil {
|
||||
t.Fatalf("get failed: %v", err)
|
||||
}
|
||||
|
||||
|
@ -73,7 +73,7 @@ func TestVersionUpgrade(t *testing.T) {
|
|||
}
|
||||
|
||||
// Retry to allow flakiness for the previous release
|
||||
if err := retry.Expo(r, 1*time.Second, 30*time.Minute, 3); err != nil {
|
||||
if err := retry.Expo(r, 1*time.Second, Minutes(30), 3); err != nil {
|
||||
t.Fatalf("release start failed: %v", err)
|
||||
}
|
||||
|
||||
|
@ -123,7 +123,7 @@ func TestVersionUpgrade(t *testing.T) {
|
|||
return err
|
||||
}
|
||||
|
||||
if err := retry.Expo(r, 1*time.Second, 30*time.Minute, 3); err == nil {
|
||||
if err := retry.Expo(r, 1*time.Second, Minutes(30), 3); err == nil {
|
||||
t.Fatalf("downgrading kubernetes should not be allowed: %v", err)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue