Skip to content

Commit 4e4f8dd

Browse files
committed
Increase go test timeout and minor cleanups
1 parent 54c9726 commit 4e4f8dd

4 files changed

Lines changed: 10 additions & 7 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ COMMIT ?= $(shell git rev-parse HEAD)
104104
SHORTCOMMIT ?= $(shell git rev-parse --short HEAD)
105105
GOBUILD_VERSION_ARGS = -ldflags "-X $(PACKAGE)/pkg/version.SHORTCOMMIT=$(SHORTCOMMIT) -X $(PACKAGE)/pkg/version.COMMIT=$(COMMIT)"
106106

107-
E2E_TIMEOUT ?= 1h
107+
E2E_TIMEOUT ?= 2h
108108
# E2E_GINKGO_LABEL_FILTER is ginkgo label query for selecting tests. See
109109
# https://onsi.github.io/ginkgo/#spec-labels. The default is to run tests on the AWS platform.
110110
E2E_GINKGO_LABEL_FILTER ?= "Platform: isSubsetOf {AWS} && CredentialsMode: isSubsetOf {Mint}"

test/e2e/istio_csr_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ import (
2626
. "github.com/onsi/gomega"
2727
)
2828

29-
// backOffLimit is the max retries for the Job
30-
const backOffLimit int32 = 10
31-
3229
// istioCSRProtoURL links to proto for istio-csr API spec
3330
const istioCSRProtoURL = "https://raw.githubusercontent.com/istio/api/v1.24.1/security/v1alpha1/ca.proto"
3431

test/e2e/suite_test.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"path/filepath"
1111
"strings"
1212
"testing"
13+
"time"
1314

1415
. "github.com/onsi/ginkgo/v2"
1516
. "github.com/onsi/gomega"
@@ -93,6 +94,11 @@ func TestAll(t *testing.T) {
9394

9495
suiteConfig, reportConfig := GinkgoConfiguration()
9596

97+
suiteConfig.Timeout = 120 * time.Minute // Set Ginkgo suite-level timeout
98+
suiteConfig.FailFast = false // Continue after first failure to see all issues
99+
suiteConfig.FlakeAttempts = 0 // Retry on flaky tests (helpful when deflaking tests)
100+
suiteConfig.MustPassRepeatedly = 1 // Must pass repeatedly times (helpful when deflaking tests)
101+
96102
testDir := getTestDir()
97103
reportConfig.JSONReport = filepath.Join(testDir, "report.json")
98104
reportConfig.JUnitReport = filepath.Join(testDir, "junit.xml")
@@ -146,6 +152,6 @@ var _ = BeforeSuite(func() {
146152
Expect(err).NotTo(HaveOccurred())
147153

148154
By("setting defaultNetworkPolicy to true")
149-
err = resetCertManagerNetworkPolicyState(context.TODO(), certmanageroperatorclient, loader)
155+
err = resetCertManagerNetworkPolicyState(context.TODO(), certmanageroperatorclient)
150156
Expect(err).NotTo(HaveOccurred())
151157
})

test/e2e/utils_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ func verifyCertificateRenewed(ctx context.Context, secretName, namespace string,
850850
}
851851

852852
// checks if expiry time was updated
853-
if *initExpiryTime == cert.NotAfter {
853+
if (*initExpiryTime).Equal(cert.NotAfter) {
854854
return false, nil
855855
}
856856

@@ -1124,7 +1124,7 @@ func VerifyContainerResources(pod corev1.Pod, containerName string, expectedReso
11241124
}
11251125

11261126
// resetCertManagerNetworkPolicyState resets the CertManager to have defaultNetworkPolicy="true"
1127-
func resetCertManagerNetworkPolicyState(ctx context.Context, client *certmanoperatorclient.Clientset, loader library.DynamicResourceLoader) error {
1127+
func resetCertManagerNetworkPolicyState(ctx context.Context, client *certmanoperatorclient.Clientset) error {
11281128
err := retry.RetryOnConflict(retry.DefaultRetry, func() error {
11291129
var operatorState *v1alpha1.CertManager
11301130
err := wait.PollUntilContextTimeout(context.TODO(), slowPollInterval, highTimeout, true, func(context.Context) (bool, error) {

0 commit comments

Comments
 (0)