diff --git a/.github/workflows/e2e_test.yml b/.github/workflows/e2e_test.yml index 47d630b4..fe0bf057 100644 --- a/.github/workflows/e2e_test.yml +++ b/.github/workflows/e2e_test.yml @@ -19,4 +19,4 @@ jobs: # Run the Python script that handles the build and execution - name: Launch Docker Stack and run tests - run: python3 main.py local && python3 main.py wait_for "https://localhost:9001/minio/health/live" && python3 main.py test \ No newline at end of file + run: python3 main.py local && python3 main.py wait_for "http://localhost:9001/minio/health/live" && python3 main.py test \ No newline at end of file diff --git a/main.py b/main.py index af3fb974..4856183e 100644 --- a/main.py +++ b/main.py @@ -127,14 +127,18 @@ def wait_for_response(url: str): docker stack does not support conditional waits and the dockerfile logic would be otherwise messy """ - TIMEOUT_SEC = 30 - while True and TIMEOUT_SEC > 0: - response = requests.get(url) - if response.status_code == 200: - print("Got 200 response from " + url) + TIMEOUT_SEC = 180 + counter = 0 + while True and counter < TIMEOUT_SEC: + try: + response = requests.get(url) + if response.status_code == 200: + print(f"Got 200 response from {url} after {counter} seconds") return + except requests.exceptions.ConnectionError: + pass time.sleep(1) - TIMEOUT_SEC -= 1 + counter += 1 raise RuntimeError( f"Timed out after {TIMEOUT_SEC} seconds waiting for response from " + url )