From 27dd40b4aa476c5c09662ff61f4606512755ceaa Mon Sep 17 00:00:00 2001 From: Oliver Falk Date: Fri, 24 Oct 2025 13:06:57 +0200 Subject: [PATCH] Improve CI output visibility and remove buffering - Add flush=True to all colored_print calls for immediate output - Add PYTHONUNBUFFERED=1 to all deployment and performance test jobs - Replace simple sleep with countdown progress indicator - Show 'Retrying in X seconds...' with real-time countdown - Clear progress line after countdown completes - Better visibility of what the script is doing during long waits --- .gitlab-ci.yml | 5 +++++ scripts/check_deployment.py | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 50332b7..3f1db78 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -161,6 +161,7 @@ performance_tests_dev: when: on_success # Run automatically after successful deployment verification variables: DEV_URL: "https://dev.libravatar.org" + PYTHONUNBUFFERED: 1 before_script: - apk add --no-cache curl - pip install requests Pillow prettytable pyLibravatar dnspython py3dns @@ -185,6 +186,7 @@ performance_tests_prod: when: on_success # Run automatically after successful deployment verification variables: PROD_URL: "https://libravatar.org" + PYTHONUNBUFFERED: 1 before_script: - apk add --no-cache curl - pip install requests Pillow prettytable pyLibravatar dnspython py3dns @@ -209,6 +211,7 @@ performance_tests_prod_manual: when: manual # Manual trigger for on-demand performance testing variables: PROD_URL: "https://libravatar.org" + PYTHONUNBUFFERED: 1 before_script: - apk add --no-cache curl - pip install requests Pillow prettytable pyLibravatar dnspython py3dns @@ -231,6 +234,7 @@ verify_dev_deployment: DEV_URL: "https://dev.libravatar.org" MAX_RETRIES: 30 RETRY_DELAY: 60 + PYTHONUNBUFFERED: 1 before_script: - apk add --no-cache curl git - pip install Pillow @@ -249,6 +253,7 @@ verify_prod_deployment: PROD_URL: "https://libravatar.org" MAX_RETRIES: 10 RETRY_DELAY: 30 + PYTHONUNBUFFERED: 1 before_script: - apk add --no-cache curl git - pip install Pillow diff --git a/scripts/check_deployment.py b/scripts/check_deployment.py index 06e4136..9b98cff 100755 --- a/scripts/check_deployment.py +++ b/scripts/check_deployment.py @@ -54,8 +54,8 @@ class Colors: def colored_print(message: str, color: str = Colors.NC) -> None: - """Print a colored message.""" - print(f"{color}{message}{Colors.NC}") + """Print a colored message with immediate flush.""" + print(f"{color}{message}{Colors.NC}", flush=True) def get_current_commit_hash() -> Optional[str]: @@ -485,7 +485,11 @@ def test_deployment( colored_print( f"Waiting {retry_delay} seconds before next attempt...", Colors.BLUE ) - time.sleep(retry_delay) + # Show progress during wait + for remaining in range(retry_delay, 0, -1): + print(f"\r⏳ Retrying in {remaining:2d} seconds...", end="", flush=True) + time.sleep(1) + print("\r" + " " * 30 + "\r", end="", flush=True) # Clear the line colored_print( f"❌ FAILED: {name} deployment verification timed out after {max_retries} attempts",