Skip to content

Commit 43c9a24

Browse files
committed
TEST/MINOR: fix some unit tests and e2e tests random failures
1 parent 455cc9b commit 43c9a24

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

deploy/tests/integration/config-snippet/suite_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
package configsnippet_test
1616

1717
import (
18+
"os"
1819
"testing"
1920

2021
"github.com/haproxytech/kubernetes-ingress/deploy/tests/integration"
@@ -44,6 +45,8 @@ func (suite *DisableConfigSnippetSuite) BeforeTest(suiteName, testName string) {
4445
suite.BaseSuite.BeforeTest(suiteName, testName)
4546
// Add any needed update to the controller setting
4647
// by updating suite.TestControllers[suite.T().Name()].XXXXX
48+
os.Unsetenv("POD_NAME")
49+
os.Unsetenv("POD_NAMESPACE")
4750
testController := suite.TestControllers[suite.T().Name()]
4851
testController.OSArgs.ConfigMap.Name = configMapName
4952
testController.OSArgs.ConfigMap.Namespace = configMapNamespace

deploy/tests/integration/pod-maxconn/suite_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
package podmaxconn
1616

1717
import (
18+
"os"
1819
"testing"
1920

2021
"github.com/haproxytech/kubernetes-ingress/deploy/tests/integration"
@@ -44,6 +45,8 @@ func (suite *PodMaxConnSuite) BeforeTest(suiteName, testName string) {
4445
suite.BaseSuite.BeforeTest(suiteName, testName)
4546
// Add any needed update to the controller setting
4647
// by updating suite.TestControllers[suite.T().Name()].XXXXX
48+
os.Unsetenv("POD_NAME")
49+
os.Unsetenv("POD_NAMESPACE")
4750
testController := suite.TestControllers[suite.T().Name()]
4851
testController.OSArgs.ConfigMap.Name = configMapName
4952
testController.OSArgs.ConfigMap.Namespace = configMapNamespace

deploy/tests/integration/timeout-server/suite_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
package timeoutserver
1616

1717
import (
18+
"os"
1819
"testing"
1920

2021
"github.com/haproxytech/kubernetes-ingress/deploy/tests/integration"
@@ -44,6 +45,8 @@ func (suite *TimeoutServerSuite) BeforeTest(suiteName, testName string) {
4445
suite.BaseSuite.BeforeTest(suiteName, testName)
4546
// Add any needed update to the controller setting
4647
// by updating suite.TestControllers[suite.T().Name()].XXXXX
48+
os.Unsetenv("POD_NAME")
49+
os.Unsetenv("POD_NAMESPACE")
4750
testController := suite.TestControllers[suite.T().Name()]
4851
testController.OSArgs.ConfigMap.Name = configMapName
4952
testController.OSArgs.ConfigMap.Namespace = configMapNamespace

0 commit comments

Comments
 (0)