Skip to content

Commit e4c2a15

Browse files
committed
fix: wait on condition for flaky tests
1 parent b0427d5 commit e4c2a15

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/e2e/tests/test_vpc.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ def test_crud_tags(self, ec2_client, simple_vpc):
230230
resource = k8s.get_resource(ref)
231231
assert len(resource["spec"]["tags"]) == 0
232232

233+
k8s.wait_on_condition(ref, "ACK.ResourceSynced", "True", wait_periods=5)
233234
# Delete k8s resource
234235
_, deleted = k8s.delete_custom_resource(ref)
235236
assert deleted is True
@@ -282,7 +283,7 @@ def test_update_disallow_default_security_group_rule(self, ec2_client, simple_vp
282283
}
283284
k8s.patch_custom_resource(ref, updates)
284285
time.sleep(MODIFY_WAIT_AFTER_SECONDS)
285-
286+
k8s.wait_on_condition(ref, "ACK.ResourceSynced", "True", wait_periods=5)
286287
# Make sure default security group rule is deleted
287288
assert not contains_default_sg_rule(ec2_client, resource_id)
288289

@@ -480,6 +481,7 @@ def test_vpc_updation_multiple_cidr(self,ec2_client):
480481
k8s.patch_custom_resource(ref, updates)
481482
time.sleep(MODIFY_WAIT_AFTER_SECONDS)
482483

484+
k8s.wait_on_condition(ref, "ACK.ResourceSynced", "True", wait_periods=5)
483485
# Re-Validate CIDR Blocks State
484486
vpc = ec2_validator.get_vpc(resource_id)
485487
assert vpc['CidrBlockAssociationSet'][0]['CidrBlockState']['State'] == "associated"

0 commit comments

Comments
 (0)