Merge master

pull/6258/head
Thomas Stromberg 2020-01-09 15:16:29 -08:00
commit 0fee6cbe3a
4 changed files with 22 additions and 9 deletions

View File

@ -33,7 +33,7 @@ func TestDockerFlags(t *testing.T) {
MaybeParallel(t)
profile := UniqueProfileName("docker-flags")
ctx, cancel := context.WithTimeout(context.Background(), 20*time.Minute)
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Minute)
defer CleanupWithLogs(t, profile, cancel)
// Use the most verbose logging for the simplest test. If it fails, something is very wrong.

View File

@ -71,7 +71,7 @@ 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", 2*time.Minute); err != nil {
if _, err := PodWait(ctx, t, profile, "default", "run=nginx-svc", 4*time.Minute); err != nil {
t.Fatalf("wait: %v", err)
}

View File

@ -172,7 +172,7 @@ func validateKubectlGetPods(ctx context.Context, t *testing.T, profile string) {
// validateAddonManager asserts that the kube-addon-manager pod is deployed properly
func validateAddonManager(ctx context.Context, t *testing.T, profile string) {
// If --wait=false, this may take a couple of minutes
if _, err := PodWait(ctx, t, profile, "kube-system", "component=kube-addon-manager", 5*time.Minute); err != nil {
if _, err := PodWait(ctx, t, profile, "kube-system", "component=kube-addon-manager", 10*time.Minute); err != nil {
t.Fatalf("wait: %v", err)
}
}
@ -482,7 +482,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", 5*time.Minute); err != nil {
if _, err := PodWait(ctx, t, profile, "default", "app=hello-node", 10*time.Minute); err != nil {
t.Fatalf("wait: %v", err)
}
@ -625,7 +625,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", 5*time.Minute)
names, err := PodWait(ctx, t, profile, "default", "app=mysql", 10*time.Minute)
if err != nil {
t.Fatalf("podwait: %v", err)
}

View File

@ -106,7 +106,8 @@ func TestStartStop(t *testing.T) {
t.Fatalf("%s failed: %v", rr.Args, err)
}
names, err := PodWait(ctx, t, profile, "default", "integration-test=busybox", 4*time.Minute)
// 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)
if err != nil {
t.Fatalf("wait: %v", err)
}
@ -161,10 +162,11 @@ func TestStartStop(t *testing.T) {
gotImages := []string{}
for _, img := range jv["images"] {
for _, i := range img.Tags {
// Ignore non-Kubernetes images
if !strings.Contains(i, "ingress") && !strings.Contains(i, "busybox") {
if defaultImage(i) {
// Remove docker.io for naming consistency between container runtimes
gotImages = append(gotImages, strings.TrimPrefix(i, "docker.io/"))
} else {
t.Logf("Found non-minikube image: %s", i)
}
}
}
@ -181,7 +183,7 @@ 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", 2*time.Minute); err != nil {
} else if _, err := PodWait(ctx, t, profile, "default", "integration-test=busybox", 4*time.Minute); err != nil {
t.Fatalf("wait: %v", err)
}
@ -201,3 +203,14 @@ func TestStartStop(t *testing.T) {
}
})
}
// defaultImage returns true if this image is expected in a default minikube install
func defaultImage(name string) bool {
if strings.Contains(name, ":latest") {
return false
}
if strings.Contains(name, "k8s.gcr.io") || strings.Contains(name, "kubernetesui") || strings.Contains(name, "storage-provisioner") {
return true
}
return false
}