Skip to content

Commit 3e8fea3

Browse files
authored
Merge pull request #3343 from oliviassss/e2e-fix
Add check for LB availability to e2e
2 parents aa893b5 + 8c91aab commit 3e8fea3

File tree

4 files changed

+25
-6
lines changed

4 files changed

+25
-6
lines changed

scripts/ci_e2e_test.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,7 @@ test_controller_image() {
209209
CERT_ID2="724963dd-f571-4f2c-b549-5c7d0e35e4b8"
210210
CERT_ID3="1001570b-1779-40c3-9b49-9a9a41e30058"
211211
CERTIFICATE_ARNS=${CERTIFICATE_ARNS:-"${CERTIFICATE_ARN_PREFIX}/${CERT_ID1},${CERTIFICATE_ARN_PREFIX}/${CERT_ID2},${CERTIFICATE_ARN_PREFIX}/${CERT_ID3}"}
212-
213-
ginkgo -v -r test/e2e -- \
212+
ginkgo -timeout 2h -v -r test/e2e -- \
214213
--kubeconfig=${CLUSTER_KUBECONFIG} \
215214
--cluster-name=${CLUSTER_NAME} \
216215
--aws-region=${AWS_REGION} \

scripts/run-e2e-test.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,11 @@ function run_ginkgo_test() {
166166
local focus=$1
167167
echo "Starting the ginkgo tests from generated ginkgo test binaries with focus: $focus"
168168
if [ "$IP_FAMILY" == "IPv4" ]; then
169-
(CGO_ENABLED=0 GOOS=$OS_OVERRIDE ginkgo --no-color $EXTRA_GINKGO_FLAGS --focus="$focus" -v --timeout 60m --fail-on-pending $GINKGO_TEST_BUILD/ingress.test -- --kubeconfig=$KUBE_CONFIG_PATH --cluster-name=$CLUSTER_NAME --aws-region=$REGION --aws-vpc-id=$VPC_ID --test-image-registry=$TEST_IMAGE_REGISTRY --ip-family=$IP_FAMILY || TEST_RESULT=fail)
170-
(CGO_ENABLED=0 GOOS=$OS_OVERRIDE ginkgo --no-color $EXTRA_GINKGO_FLAGS --focus="$focus" -v --timeout 60m --fail-on-pending $GINKGO_TEST_BUILD/service.test -- --kubeconfig=$KUBE_CONFIG_PATH --cluster-name=$CLUSTER_NAME --aws-region=$REGION --aws-vpc-id=$VPC_ID --test-image-registry=$TEST_IMAGE_REGISTRY --ip-family=$IP_FAMILY || TEST_RESULT=fail)
169+
(CGO_ENABLED=0 GOOS=$OS_OVERRIDE ginkgo --no-color $EXTRA_GINKGO_FLAGS --focus="$focus" -v --timeout 2h --fail-on-pending $GINKGO_TEST_BUILD/ingress.test -- --kubeconfig=$KUBE_CONFIG_PATH --cluster-name=$CLUSTER_NAME --aws-region=$REGION --aws-vpc-id=$VPC_ID --test-image-registry=$TEST_IMAGE_REGISTRY --ip-family=$IP_FAMILY || TEST_RESULT=fail)
170+
(CGO_ENABLED=0 GOOS=$OS_OVERRIDE ginkgo --no-color $EXTRA_GINKGO_FLAGS --focus="$focus" -v --timeout 2h --fail-on-pending $GINKGO_TEST_BUILD/service.test -- --kubeconfig=$KUBE_CONFIG_PATH --cluster-name=$CLUSTER_NAME --aws-region=$REGION --aws-vpc-id=$VPC_ID --test-image-registry=$TEST_IMAGE_REGISTRY --ip-family=$IP_FAMILY || TEST_RESULT=fail)
171171
elif [ "$IP_FAMILY" == "IPv6" ]; then
172-
(CGO_ENABLED=0 GOOS=$OS_OVERRIDE ginkgo --no-color $EXTRA_GINKGO_FLAGS --focus="$focus" --skip="instance" -v --timeout 60m --fail-on-pending $GINKGO_TEST_BUILD/ingress.test -- --kubeconfig=$KUBE_CONFIG_PATH --cluster-name=$CLUSTER_NAME --aws-region=$REGION --aws-vpc-id=$VPC_ID --test-image-registry=$TEST_IMAGE_REGISTRY --ip-family=$IP_FAMILY || TEST_RESULT=fail)
173-
(CGO_ENABLED=0 GOOS=$OS_OVERRIDE ginkgo --no-color $EXTRA_GINKGO_FLAGS --focus="$focus" --skip="instance" -v --timeout 60m --fail-on-pending $GINKGO_TEST_BUILD/service.test -- --kubeconfig=$KUBE_CONFIG_PATH --cluster-name=$CLUSTER_NAME --aws-region=$REGION --aws-vpc-id=$VPC_ID --test-image-registry=$TEST_IMAGE_REGISTRY --ip-family=$IP_FAMILY || TEST_RESULT=fail)
172+
(CGO_ENABLED=0 GOOS=$OS_OVERRIDE ginkgo --no-color $EXTRA_GINKGO_FLAGS --focus="$focus" --skip="instance" -v --timeout 2h --fail-on-pending $GINKGO_TEST_BUILD/ingress.test -- --kubeconfig=$KUBE_CONFIG_PATH --cluster-name=$CLUSTER_NAME --aws-region=$REGION --aws-vpc-id=$VPC_ID --test-image-registry=$TEST_IMAGE_REGISTRY --ip-family=$IP_FAMILY || TEST_RESULT=fail)
173+
(CGO_ENABLED=0 GOOS=$OS_OVERRIDE ginkgo --no-color $EXTRA_GINKGO_FLAGS --focus="$focus" --skip="instance" -v --timeout 2h --fail-on-pending $GINKGO_TEST_BUILD/service.test -- --kubeconfig=$KUBE_CONFIG_PATH --cluster-name=$CLUSTER_NAME --aws-region=$REGION --aws-vpc-id=$VPC_ID --test-image-registry=$TEST_IMAGE_REGISTRY --ip-family=$IP_FAMILY || TEST_RESULT=fail)
174174
else
175175
echo "Invalid IP_FAMILY input, choose from IPv4 or IPv6 only"
176176
fi

test/e2e/service/nlb_instance_target_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,10 @@ var _ = Describe("test k8s service reconciled by the aws load balancer controlle
207207
})
208208
}, utils.PollTimeoutShort, utils.PollIntervalMedium).Should(BeTrue())
209209
})
210+
By("waiting for load balancer to be available", func() {
211+
err := tf.LBManager.WaitUntilLoadBalancerAvailable(ctx, lbARN)
212+
Expect(err).NotTo(HaveOccurred())
213+
})
210214
})
211215
It("should create TLS listeners", func() {
212216
if len(tf.Options.CertificateARNs) == 0 {
@@ -269,6 +273,10 @@ var _ = Describe("test k8s service reconciled by the aws load balancer controlle
269273
return verifyLoadBalancerListenerCertificates(ctx, tf, lbARN, certs) == nil
270274
}, utils.PollTimeoutShort, utils.PollIntervalMedium).Should(BeTrue())
271275
})
276+
By("waiting for load balancer to be available", func() {
277+
err := tf.LBManager.WaitUntilLoadBalancerAvailable(ctx, lbARN)
278+
Expect(err).NotTo(HaveOccurred())
279+
})
272280
})
273281
It("should enable proxy protocol v2", func() {
274282
By("deploying stack", func() {
@@ -300,6 +308,10 @@ var _ = Describe("test k8s service reconciled by the aws load balancer controlle
300308
})
301309
}, utils.PollTimeoutShort, utils.PollIntervalMedium).Should(BeTrue())
302310
})
311+
By("waiting for load balancer to be available", func() {
312+
err := tf.LBManager.WaitUntilLoadBalancerAvailable(ctx, lbARN)
313+
Expect(err).NotTo(HaveOccurred())
314+
})
303315
})
304316
})
305317

@@ -346,6 +358,10 @@ var _ = Describe("test k8s service reconciled by the aws load balancer controlle
346358
err = verifyTargetGroupNumRegistered(ctx, tf, tgARN, len(nodes))
347359
Expect(err).ToNot(HaveOccurred())
348360
})
361+
By("waiting for load balancer to be available", func() {
362+
err := tf.LBManager.WaitUntilLoadBalancerAvailable(ctx, lbARN)
363+
Expect(err).NotTo(HaveOccurred())
364+
})
349365
})
350366
})
351367
})

test/e2e/service/nlb_ip_target_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,10 @@ var _ = Describe("k8s service reconciled by the aws load balancer", func() {
405405
})
406406
Expect(err).ToNot(HaveOccurred())
407407
})
408+
By("waiting for load balancer to be available", func() {
409+
err := tf.LBManager.WaitUntilLoadBalancerAvailable(ctx, lbARN)
410+
Expect(err).NotTo(HaveOccurred())
411+
})
408412
})
409413
})
410414
})

0 commit comments

Comments
 (0)