From 71ce8353cf9392c142528c31100a4edf83a83005 Mon Sep 17 00:00:00 2001 From: Kshitij Aranke Date: Tue, 21 May 2024 21:02:13 +0100 Subject: [PATCH] [Backport 1.2.latest] Fix #9907: Add retry to tox to reduce flaky tests due to network failures (#10182) --- .github/workflows/main.yml | 16 ++++++++++++---- .../structured-logging-schema-check.yml | 6 +++++- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 580c8a49f35..aeca00b985d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -93,8 +93,12 @@ jobs: python -m pip install tox tox --version - - name: Run tox - run: tox + - name: Run unit tests + uses: nick-fields/retry@v3 + with: + timeout_minutes: 10 + max_attempts: 3 + command: tox -e unit - name: Get current date if: always() @@ -166,8 +170,12 @@ jobs: python -m pip install tox tox --version - - name: Run tests - run: tox -- --ddtrace + - name: Run integration tests + uses: nick-fields/retry@v3 + with: + timeout_minutes: 30 + max_attempts: 3 + command: tox -- --ddtrace - name: Get current date if: always() diff --git a/.github/workflows/structured-logging-schema-check.yml b/.github/workflows/structured-logging-schema-check.yml index c92d9f23659..d28695a0a48 100644 --- a/.github/workflows/structured-logging-schema-check.yml +++ b/.github/workflows/structured-logging-schema-check.yml @@ -70,7 +70,11 @@ jobs: # integration tests generate a ton of logs in different files. the next step will find them all. # we actually care if these pass, because the normal test run doesn't usually include many json log outputs - name: Run integration tests - run: tox -e integration -- -nauto + uses: nick-fields/retry@v3 + with: + timeout_minutes: 30 + max_attempts: 3 + command: tox -e integration -- -nauto - name: Archive code coverage results uses: actions/upload-artifact@v4