diff --git a/test/e2e/framework/framework.go b/test/e2e/framework/framework.go index 27fdabec5..cde653b0a 100644 --- a/test/e2e/framework/framework.go +++ b/test/e2e/framework/framework.go @@ -107,6 +107,7 @@ type Framework struct { // we install a Cleanup action before each test and clear it after. If we // should abort, the AfterSuite hook should run all Cleanup actions. cleanupHandle CleanupActionHandle + stopped bool } var ( @@ -415,6 +416,7 @@ func deleteNamespace(client kubeclientset.Interface, namespaceName string) error // AfterEach deletes the namespace, after reading its events. func (f *Framework) AfterEach() { + f.stopped = true RemoveCleanupAction(f.cleanupHandle) var nsDeletionErrors []error @@ -435,7 +437,7 @@ func (f *Framework) AfterEach() { // if we had errors deleting, report them now. if len(nsDeletionErrors) != 0 { - Failf(k8serrors.NewAggregate(nsDeletionErrors).Error()) + Errorf(k8serrors.NewAggregate(nsDeletionErrors).Error()) } } diff --git a/test/e2e/framework/nodes.go b/test/e2e/framework/nodes.go index fff97916b..3d34eacd4 100644 --- a/test/e2e/framework/nodes.go +++ b/test/e2e/framework/nodes.go @@ -77,6 +77,11 @@ func (f *Framework) SetGatewayLabelOnNode(ctx context.Context, cluster ClusterIn PatchString("/metadata/labels/"+strings.ReplaceAll(GatewayLabel, "/", "~1"), strconv.FormatBool(isGateway), func(pt types.PatchType, payload []byte) error { _, err := KubeClients[cluster].CoreV1().Nodes().Patch(ctx, nodeName, pt, payload, metav1.PatchOptions{}) + if err != nil && f.stopped { + Errorf("Error setting gateway label on node %q: %v", nodeName, err) + err = nil + } + return err }) }