Skip to content

Commit c13aa3e

Browse files
authored
chore: retry 4 times with 30s wait if the stack deletion fails (#2714)
1 parent 5a3e9da commit c13aa3e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

integration/helpers/base_test.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
retry,
2929
stop_after_attempt,
3030
wait_exponential,
31+
wait_fixed,
3132
retry_if_exception_type,
3233
after_log,
3334
wait_random,
@@ -115,9 +116,17 @@ def setUp(self):
115116
self.output_file_path = None
116117
self.sub_input_file_path = None
117118

119+
@retry(
120+
stop=stop_after_attempt(5),
121+
wait=wait_fixed(30),
122+
retry=retry_if_exception_type(Exception),
123+
)
118124
def tearDown(self):
119125
if self.stack_name:
120-
self.client_provider.cfn_client.delete_stack(StackName=self.stack_name)
126+
client = self.client_provider.cfn_client
127+
client.delete_stack(StackName=self.stack_name)
128+
waiter = client.get_waiter("stack_delete_complete")
129+
waiter.wait(StackName=self.stack_name)
121130
if self.output_file_path and os.path.exists(self.output_file_path):
122131
os.remove(self.output_file_path)
123132
if self.sub_input_file_path and os.path.exists(self.sub_input_file_path):

0 commit comments

Comments
 (0)