Skip to content

Commit 209aa8e

Browse files
author
Ryan Lymburner
committed
Task 10: Address propagation delay in tests
1 parent 15b0dd0 commit 209aa8e

17 files changed

+40
-68
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,12 @@ e2e-test: ## Run e2e tests against cluster pointed to by ~/.kube/config
120120
cd test && go test \
121121
-p 1 \
122122
-count 1 \
123-
-timeout 90m \
123+
-timeout 120m \
124124
-v \
125125
./suites/integration/... \
126126
--ginkgo.focus="${FOCUS}" \
127127
--ginkgo.skip="${SKIP}" \
128-
--ginkgo.timeout=90m \
128+
--ginkgo.timeout=120m \
129129
--ginkgo.v
130130

131131
.SILENT:

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ require (
5858
github.com/prometheus/procfs v0.15.1 // indirect
5959
github.com/sirupsen/logrus v1.9.3 // indirect
6060
github.com/spf13/pflag v1.0.6 // indirect
61-
github.com/stretchr/objx v0.5.2 // indirect
6261
github.com/x448/float16 v0.8.4 // indirect
6362
go.uber.org/multierr v1.11.0 // indirect
6463
golang.org/x/net v0.38.0 // indirect

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,6 @@ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVs
127127
github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o=
128128
github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
129129
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
130-
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
131-
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
132130
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
133131
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
134132
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=

pkg/deploy/lattice/health_check_resolver_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func TestHealthCheckConfigResolver_ResolveHealthCheckConfig(t *testing.T) {
7575

7676
// Create scheme and add required types
7777
scheme := runtime.NewScheme()
78-
_ = anv1alpha1.AddToScheme(scheme)
78+
_ = anv1alpha1.Install(scheme)
7979
_ = corev1.AddToScheme(scheme)
8080

8181
// Create fake client with no objects
@@ -434,9 +434,9 @@ func Test_ResolveHealthCheckConfig_WithPolicies(t *testing.T) {
434434

435435
// Create scheme and add required types
436436
scheme := runtime.NewScheme()
437-
_ = anv1alpha1.AddToScheme(scheme)
437+
_ = anv1alpha1.Install(scheme)
438438
_ = corev1.AddToScheme(scheme)
439-
_ = gwv1alpha2.AddToScheme(scheme)
439+
_ = gwv1alpha2.Install(scheme)
440440

441441
// Convert policies to client.Object slice
442442
objects := make([]client.Object, len(tt.policies))

pkg/deploy/lattice/target_group_manager_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,9 +1407,9 @@ func Test_update_ServiceExportWithPolicyResolution(t *testing.T) {
14071407

14081408
// Create scheme and add required types
14091409
scheme := runtime.NewScheme()
1410-
_ = anv1alpha1.AddToScheme(scheme)
1410+
_ = anv1alpha1.Install(scheme)
14111411
_ = corev1.AddToScheme(scheme)
1412-
_ = gwv1alpha2.AddToScheme(scheme)
1412+
_ = gwv1alpha2.Install(scheme)
14131413

14141414
// Create fake client with policy if provided
14151415
clientBuilder := fake.NewClientBuilder().WithScheme(scheme)
@@ -1595,7 +1595,7 @@ func Test_update_BackwardsCompatibility(t *testing.T) {
15951595
if tt.client {
15961596
// Create scheme and add required types
15971597
scheme := runtime.NewScheme()
1598-
_ = anv1alpha1.AddToScheme(scheme)
1598+
_ = anv1alpha1.Install(scheme)
15991599
_ = corev1.AddToScheme(scheme)
16001600
k8sClient = fake.NewClientBuilder().WithScheme(scheme).Build()
16011601
}

pkg/k8s/policyhelper/policy_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,9 @@ func Test_FindPolicyForService_ServiceBasedResolution(t *testing.T) {
262262

263263
// Create scheme and add required types
264264
scheme := runtime.NewScheme()
265-
_ = anv1alpha1.AddToScheme(scheme)
265+
_ = anv1alpha1.Install(scheme)
266266
_ = corev1.AddToScheme(scheme)
267-
_ = gwv1alpha2.AddToScheme(scheme)
267+
_ = gwv1alpha2.Install(scheme)
268268

269269
// Convert policies to client.Object slice
270270
objects := make([]client.Object, len(tt.policies))

test/pkg/test/framework.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ func NewFramework(ctx context.Context, log gwlog.Logger, testNamespace string) *
143143
}
144144
framework.Cloud = anaws.NewDefaultCloud(framework.LatticeClient, cloudConfig)
145145
framework.DefaultTags = framework.Cloud.DefaultTags()
146-
SetDefaultEventuallyTimeout(3 * time.Minute)
146+
SetDefaultEventuallyTimeout(5 * time.Minute)
147147
SetDefaultEventuallyPollingInterval(10 * time.Second)
148148
return framework
149149
}

test/suites/integration/access_log_policy_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,6 @@ var _ = Describe("Access Log Policy", Ordered, func() {
8787
)
8888

8989
BeforeAll(func() {
90-
SetDefaultEventuallyTimeout(5 * time.Minute)
91-
SetDefaultEventuallyPollingInterval(10 * time.Second)
92-
9390
awsResourceName = awsResourceNamePrefix + utils.RandomAlphaString(10)
9491

9592
tags := testFramework.NewTestTags(testSuite)

test/suites/integration/byoc_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ var _ = Describe("Bring your own certificate (BYOC)", Ordered, func() {
103103
g.Expect(err).To(BeNil())
104104
g.Expect(stdout).To(ContainSubstring("byoc-app handler pod"))
105105
g.Expect(stderr).To(ContainSubstring("issuer: O=byoc-e2e-test"))
106-
}).WithTimeout(30 * time.Second).WithOffset(1).Should(Succeed())
106+
}).Should(Succeed())
107107
})
108108

109109
AfterAll(func() {

test/suites/integration/grpcroute_serviceexport_test.go

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
package integration
22

33
import (
4-
"log"
5-
"os"
6-
"time"
7-
84
"github.com/aws/aws-application-networking-k8s/pkg/model/core"
95
"github.com/aws/aws-application-networking-k8s/test/pkg/test"
106
"github.com/aws/aws-sdk-go/aws"
@@ -15,6 +11,8 @@ import (
1511
appsv1 "k8s.io/api/apps/v1"
1612
v1 "k8s.io/api/core/v1"
1713
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
14+
"log"
15+
"os"
1816
gwv1 "sigs.k8s.io/gateway-api/apis/v1"
1917

2018
anv1alpha1 "github.com/aws/aws-application-networking-k8s/pkg/apis/applicationnetworking/v1alpha1"
@@ -29,11 +27,6 @@ var _ = Describe("GRPCRoute Service Export/Import Test", Ordered, func() {
2927
serviceImport *anv1alpha1.ServiceImport
3028
)
3129

32-
BeforeAll(func() {
33-
SetDefaultEventuallyTimeout(5 * time.Minute)
34-
SetDefaultEventuallyPollingInterval(10 * time.Second)
35-
})
36-
3730
It("Create k8s resource", func() {
3831
// Create a gRPC service and deployment
3932
grpcDeployment, grpcSvc = testFramework.NewGrpcHelloWorld(test.GrpcAppOptions{AppName: "my-grpc-exportedports", Namespace: k8snamespace})
@@ -119,7 +112,7 @@ var _ = Describe("GRPCRoute Service Export/Import Test", Ordered, func() {
119112
for _, target := range targets {
120113
g.Expect(*target.Port).To(BeEquivalentTo(grpcSvc.Spec.Ports[0].TargetPort.IntVal))
121114
}
122-
}).WithTimeout(3 * time.Minute).WithOffset(1).Should(Succeed())
115+
}).Should(Succeed())
123116

124117
log.Println("Verifying traffic")
125118
grpcurlCmdOptions := test.RunGrpcurlCmdOptions{

0 commit comments

Comments
 (0)