Skip to content

Commit

Permalink
Update function for get execution status
Browse files Browse the repository at this point in the history
  • Loading branch information
oksanagorbachenko committed Nov 21, 2023
1 parent 34da2f5 commit a3f1ee4
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tests/smoke_test/test_aws_SF_execution.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import time

import boto3
import botocore
import json
Expand Down Expand Up @@ -48,16 +50,17 @@ def run_step_function():


def get_sf_execution_status(execution_arn):
while True:
response = sfn_client.describe_execution(
executionArn=execution_arn
)

max_iterations = 100
for _ in range(max_iterations):
response = sfn_client.describe_execution(executionArn=execution_arn)
status = response['status']
logger.info(f"Execution status: {status}")

if status in ["SUCCEEDED", "FAILED"]:
break
time.sleep(10)
else:
logger.warning("Maximum iterations reached. Exiting loop.")


def get_sf_events_status(execution_arn):
Expand Down

0 comments on commit a3f1ee4

Please sign in to comment.