From d80d3e16a4dd0db193e809cca4a4272a82176069 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Tue, 25 Jul 2023 18:17:56 +0000 Subject: [PATCH] Build/Test Tools: Restore automatically retrying failed E2E tests once. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This restores the GitHub Actions job responsible for automatically retrying a failed workflow once within the E2E testing workflow. [56198] disabled Slack notifications for this workflow because of the increased number of timeout errors occurring after recent changes until they could be further investigated. Even though the signal-to-noise ration was way too high, there’s still benefit in retrying the workflow once to see if the timeout can be resolved without human intervention. The one retry attempt will not result in any Slack notifications. Follow up to [56198]. See #58779. git-svn-id: https://develop.svn.wordpress.org/trunk@56308 602fd350-edb4-49c9-b593-d223f7449a82 --- .github/workflows/end-to-end-tests.yml | 31 ++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/.github/workflows/end-to-end-tests.yml b/.github/workflows/end-to-end-tests.yml index f87556d093..09a6b83897 100644 --- a/.github/workflows/end-to-end-tests.yml +++ b/.github/workflows/end-to-end-tests.yml @@ -126,3 +126,34 @@ jobs: - name: Ensure version-controlled files are not modified or deleted run: git diff --exit-code + + failed-workflow: + name: Failed workflow tasks + runs-on: ubuntu-latest + permissions: + actions: write + needs: [ e2e-tests ] + if: | + always() && + github.repository == 'WordPress/wordpress-develop' && + github.event_name != 'pull_request' && + github.run_attempt < 2 && + ( + needs.e2e-tests.result == 'cancelled' || needs.e2e-tests.result == 'failure' + ) + steps: + - name: Dispatch workflow run + uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0 + with: + retries: 2 + retry-exempt-status-codes: 418 + script: | + github.rest.actions.createWorkflowDispatch({ + owner: context.repo.owner, + repo: context.repo.repo, + workflow_id: 'failed-workflow.yml', + ref: 'trunk', + inputs: { + run_id: '${{ github.run_id }}' + } + });