Skip to content

Commit

Permalink
test: add shell-based retry wrapper to uc tests
Browse files Browse the repository at this point in the history
Signed-off-by: Omkar P <[email protected]>
  • Loading branch information
omkar-foss committed Feb 24, 2025
1 parent 49d7182 commit ef51bb3
Showing 1 changed file with 30 additions and 5 deletions.
35 changes: 30 additions & 5 deletions .github/workflows/python_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,20 @@ jobs:
run: make setup-dat

- name: Run tests
run: uv run --no-sync pytest -m '(unitycatalog_databricks and integration)' --doctest-modules
run: set -e
MAX_RETRIES=3
RETRY_DELAY=10
ATTEMPT=1
until [ $ATTEMPT -gt $MAX_RETRIES ]
do
echo "Attempt $ATTEMPT"
uv run --no-sync pytest -m '(unitycatalog_databricks and integration)' --doctest-modules
sleep $RETRY_DELAY
done
if [ $ATTEMPT -gt $MAX_RETRIES ]; then
echo "Tests failed after $MAX_RETRIES attempts."
exit 1
fi

test-unitycatalog-oss:
name: Python Build (Python 3.10 Unity Catalog Integration tests)
Expand Down Expand Up @@ -165,11 +178,23 @@ jobs:
- name: Download Data Acceptance Tests (DAT) files
run: make setup-dat

- name: Sleep for 10 seconds to avoid conflicts with previous UC test
run: sleep 10

- name: Run tests
run: uv run --no-sync pytest -m '(unitycatalog_oss and integration)' --doctest-modules
run: |
set -e
MAX_RETRIES=3
RETRY_DELAY=10
ATTEMPT=1
until [ $ATTEMPT -gt $MAX_RETRIES ]
do
echo "Attempt $ATTEMPT"
uv run --no-sync pytest -m '(unitycatalog_oss and integration)' --doctest-modules
ATTEMPT=$((ATTEMPT+1))
sleep $RETRY_DELAY
done
if [ $ATTEMPT -gt $MAX_RETRIES ]; then
echo "Tests failed after $MAX_RETRIES attempts."
exit 1
fi
test-pyspark:
name: PySpark Integration Tests
Expand Down

0 comments on commit ef51bb3

Please sign in to comment.