From 43333bdb94488cc236d9e1dc512c45c634e5a04f Mon Sep 17 00:00:00 2001 From: Mark Chappell Date: Wed, 22 Nov 2023 15:27:24 +0100 Subject: [PATCH] ec2_vpc_dhcp_option - wait for deletion to complete (#1873) (test flake) ec2_vpc_dhcp_option - wait for deletion to complete SUMMARY When replacing a DHCP Option Set we support automatically deleting the old option set. As usual with AWS this isn't guaranteed to be instantaneous. Long term it would be better to add a waiter, however the current tests being flaky has knock-on effects for unrelated changes (including releases) ISSUE TYPE Bugfix Pull Request COMPONENT NAME ec2_vpc_dhcp_option ADDITIONAL INFORMATION See for example: https://3d501427efede331c985-f49494dc6c135cc7f150f68fb57cd0c3.ssl.cf2.rackcdn.com/1829/a5289bee768839bf9bcb738523e28fd78ab68a5d/check/integration-amazon.aws-21/ae2a719/job-output.txt The test cleanup includes listing all option sets (none left) and demonstrates that without further intervention the option set was gone. Reviewed-by: Alina Buzachis --- .../targets/ec2_vpc_dhcp_option/tasks/main.yml | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/tests/integration/targets/ec2_vpc_dhcp_option/tasks/main.yml b/tests/integration/targets/ec2_vpc_dhcp_option/tasks/main.yml index 65c124f3c73..39019e77278 100644 --- a/tests/integration/targets/ec2_vpc_dhcp_option/tasks/main.yml +++ b/tests/integration/targets/ec2_vpc_dhcp_option/tasks/main.yml @@ -388,22 +388,15 @@ dhcp_options_ids: ["{{ original_dhcp_options_id }}"] register: dhcp_options ignore_errors: yes + retries: 5 + until: dhcp_options is failed + delay: 5 - assert: that: - dhcp_options.failed - '"does not exist" in dhcp_options.error.message' - - name: verify the original set was deleted - ec2_vpc_dhcp_option_info: - dhcp_options_ids: ["{{ original_dhcp_options_id }}"] - register: dhcp_options - ignore_errors: yes - - - assert: - that: - - '"does not exist" in dhcp_options.error.message' - - set_fact: original_dhcp_options_id: "{{ new_dhcp_options_id }}"