diff --git a/test/e2e/autoscale_test.go b/test/e2e/autoscale_test.go index 5aab758016d1..88707db771f1 100644 --- a/test/e2e/autoscale_test.go +++ b/test/e2e/autoscale_test.go @@ -217,6 +217,7 @@ func setup(t *testing.T, class, metric string, target, targetUtilization float64 }), }, fopts...)...) if err != nil { + test.TearDown(clients, names) t.Fatalf("Failed to create initial Service: %v: %v", names.Service, err) } diff --git a/test/e2e/destroypod_test.go b/test/e2e/destroypod_test.go index 34da95f14aab..7a9d2334f2af 100644 --- a/test/e2e/destroypod_test.go +++ b/test/e2e/destroypod_test.go @@ -61,7 +61,10 @@ func TestDestroyPodInflight(t *testing.T) { Route: svcName, Image: "timeout", } + test.CleanupOnInterrupt(func() { test.TearDown(clients, names) }) + defer test.TearDown(clients, names) + t.Log("Creating a new Route and Configuration") if _, err := v1a1test.CreateConfiguration(t, clients, names, v1a1opts.WithConfigRevisionTimeoutSeconds(revisionTimeoutSeconds)); err != nil { t.Fatalf("Failed to create Configuration: %v", err) } @@ -69,9 +72,6 @@ func TestDestroyPodInflight(t *testing.T) { t.Fatalf("Failed to create Route: %v", err) } - test.CleanupOnInterrupt(func() { test.TearDown(clients, names) }) - defer test.TearDown(clients, names) - t.Log("When the Revision can have traffic routed to it, the Route is marked as Ready") if err := v1a1test.WaitForRouteState(clients.ServingAlphaClient, names.Route, v1a1test.IsRouteReady, "RouteIsReady"); err != nil { t.Fatalf("The Route %s was not marked as Ready to serve traffic: %v", names.Route, err)