Skip to content

Commit e8c4619

Browse files
authored
Fix flaky nodegroup e2e tests (#174)
Issue #, if available: Description of changes: - Add waits for Synced condition before asserting nodegroup status By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent bc49dee commit e8c4619

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/e2e/tests/test_nodegroup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
import pytest
2222

23-
from acktest.k8s import resource as k8s
23+
from acktest.k8s import resource as k8s, condition
2424
from acktest.resources import random_suffix_name
2525
from e2e import CRD_VERSION, service_marker, CRD_GROUP, load_eks_resource
2626
from e2e.replacement_values import REPLACEMENT_VALUES
@@ -40,7 +40,7 @@
4040
CREATE_WAIT_AFTER_SECONDS = 10
4141

4242
# Time to wait after modifying the CR for the status to change
43-
MODIFY_WAIT_AFTER_SECONDS = 5
43+
MODIFY_WAIT_AFTER_SECONDS = 10
4444

4545
# Time to wait after the nodegroup has changed status, for the CR to update
4646
CHECK_STATUS_WAIT_SECONDS = 10
@@ -139,7 +139,7 @@ def test_create_update_delete_nodegroup(self, simple_nodegroup, eks_client):
139139
wait_for_nodegroup_active(eks_client, cluster_name, nodegroup_name)
140140

141141
# Ensure status is updated properly once it has become active
142-
time.sleep(CHECK_STATUS_WAIT_SECONDS)
142+
k8s.wait_on_condition(ref, condition.CONDITION_TYPE_RESOURCE_SYNCED, "True", wait_periods=5, period_length=CHECK_STATUS_WAIT_SECONDS)
143143
get_and_assert_status(ref, 'ACTIVE', True)
144144

145145
aws_res = eks_client.describe_nodegroup(
@@ -370,7 +370,7 @@ def test_update_nodegroup_version(self, simple_nodegroup, eks_client):
370370
wait_for_nodegroup_active(eks_client, cluster_name, nodegroup_name)
371371

372372
# Ensure status is updated properly once it has become active
373-
time.sleep(CHECK_STATUS_WAIT_SECONDS)
373+
k8s.wait_on_condition(ref, condition.CONDITION_TYPE_RESOURCE_SYNCED, "True", wait_periods=5, period_length=CHECK_STATUS_WAIT_SECONDS)
374374
get_and_assert_status(ref, 'ACTIVE', True)
375375

376376
aws_res = eks_client.describe_nodegroup(

0 commit comments

Comments
 (0)