From 020946ffdd36e5b91abfa5a97c7761086073e971 Mon Sep 17 00:00:00 2001 From: Quan Tian Date: Tue, 16 Mar 2021 17:22:07 +0800 Subject: [PATCH] Do not override global testData in e2e tests (#1955) Otherwise a setup failure would panic and terminate all tests. --- test/e2e/nodeportlocal_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/e2e/nodeportlocal_test.go b/test/e2e/nodeportlocal_test.go index c59f2dc7bd0..5e8497a313d 100644 --- a/test/e2e/nodeportlocal_test.go +++ b/test/e2e/nodeportlocal_test.go @@ -157,8 +157,7 @@ func validatePortInRange(t *testing.T, nplAnnotations []k8s.NPLAnnotation, start func TestNPLAddPod(t *testing.T) { skipIfNotIPv4Cluster(t) - var err error - testData, err = setupTest(t) + testData, err := setupTest(t) if err != nil { t.Fatalf("Error when setting up test: %v", err) }