diff --git a/test/e2e/benchmark.go b/test/e2e/benchmark.go index 159926780..49de9c3e1 100644 --- a/test/e2e/benchmark.go +++ b/test/e2e/benchmark.go @@ -37,7 +37,14 @@ func waitResource(ctx context.Context, t *testing.T, kwokctlPath, name, resource defer func() { cancel() }() - cmd := exec.CommandContext(watchCtx, kwokctlPath, "--name", name, "kubectl", "get", "--no-headers", "--watch", resource) + args := []string{ + "--name", name, + "kubectl", "get", resource, + "--watch", "--output-watch-events", + "-o", "template", + "--template", `{{.object.metadata.name}} {{.type}} {{.object.status.phase}} {{ "\n" }}`, + } + cmd := exec.CommandContext(watchCtx, kwokctlPath, args...) cmd.Stderr = os.Stderr pr, err := cmd.StdoutPipe() if err != nil { @@ -70,7 +77,7 @@ func waitResource(ctx context.Context, t *testing.T, kwokctlPath, name, resource } cancel() watchCtx, cancel = context.WithCancel(ctx) - cmd = exec.CommandContext(watchCtx, kwokctlPath, "--name", name, "kubectl", "get", "--no-headers", "--watch", resource) + cmd = exec.CommandContext(watchCtx, kwokctlPath, args...) cmd.Stderr = os.Stderr pr, err = cmd.StdoutPipe() if err != nil { @@ -149,7 +156,7 @@ func scaleDeletePod(ctx context.Context, t *testing.T, kwokctlPath string, name scaleCmd.Stdout = os.Stderr scaleCmd.Stderr = os.Stderr - if err := waitResource(ctx, t, kwokctlPath, name, "Pod", "Terminating", size, 0, 0, scaleCmd.Start); err != nil { + if err := waitResource(ctx, t, kwokctlPath, name, "Pod", "DELETED", size, 0, 0, scaleCmd.Start); err != nil { return fmt.Errorf("failed to wait for resource: %w", err) } return nil @@ -160,7 +167,7 @@ func scaleCreateNode(ctx context.Context, t *testing.T, kwokctlPath string, name scaleCmd.Stdout = os.Stderr scaleCmd.Stderr = os.Stderr - if err := waitResource(ctx, t, kwokctlPath, name, "Node", "Ready", size, 10, 30, scaleCmd.Start); err != nil { + if err := waitResource(ctx, t, kwokctlPath, name, "Node", "Running", size, 10, 30, scaleCmd.Start); err != nil { return fmt.Errorf("failed to wait for resource: %w", err) } return nil diff --git a/test/e2e/benchmark_hack.go b/test/e2e/benchmark_hack.go index e74927c22..781023841 100644 --- a/test/e2e/benchmark_hack.go +++ b/test/e2e/benchmark_hack.go @@ -100,7 +100,7 @@ func scaleDeletePodWithHack(ctx context.Context, t *testing.T, kwokctlPath strin scaleCmd := exec.CommandContext(ctx, kwokctlPath, "--name", name, "hack", "put", "--path", "-") scaleCmd.Stdin = readerPodDeleteYaml(size) - if err := waitResource(ctx, t, kwokctlPath, name, "Pod", "Terminating", size, 0, 0, scaleCmd.Start); err != nil { + if err := waitResource(ctx, t, kwokctlPath, name, "Pod", "DELETED", size, 0, 0, scaleCmd.Start); err != nil { return fmt.Errorf("failed to wait for resource: %w", err) } return nil @@ -152,7 +152,7 @@ func scaleCreateNodeWithHack(ctx context.Context, t *testing.T, kwokctlPath stri scaleCmd := exec.CommandContext(ctx, kwokctlPath, "--name", name, "hack", "put", "--path", "-") scaleCmd.Stdin = readerNodeYaml(size) - if err := waitResource(ctx, t, kwokctlPath, name, "Node", "Ready", size, 10, 20, scaleCmd.Start); err != nil { + if err := waitResource(ctx, t, kwokctlPath, name, "Node", "Running", size, 10, 20, scaleCmd.Start); err != nil { return fmt.Errorf("failed to wait for resource: %w", err) } return nil diff --git a/test/e2e/kwokctl/benchmark-hack/main_test.go b/test/e2e/kwokctl/benchmark-hack/main_test.go index 23c308378..4ecc8d522 100644 --- a/test/e2e/kwokctl/benchmark-hack/main_test.go +++ b/test/e2e/kwokctl/benchmark-hack/main_test.go @@ -47,6 +47,7 @@ var ( "--disable-kube-scheduler", "--disable-qps-limits", "--controller-port=10247", + "--node-lease-duration-seconds=3600", } ) diff --git a/test/e2e/kwokctl/benchmark/main_test.go b/test/e2e/kwokctl/benchmark/main_test.go index 7de17bace..03f5e4490 100644 --- a/test/e2e/kwokctl/benchmark/main_test.go +++ b/test/e2e/kwokctl/benchmark/main_test.go @@ -47,6 +47,7 @@ var ( "--disable-kube-scheduler", "--disable-qps-limits", "--controller-port=10247", + "--node-lease-duration-seconds=3600", } )