From 3f5156ee6229b97f513c002980a116a84e9a0da8 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Tue, 21 May 2024 11:21:01 -0700 Subject: [PATCH 1/2] [CI] Set `retryOnFailure` for Xcode Unit and Integration tests --- packages/rn-tester/RNTester/RNTester.xctestplan | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/rn-tester/RNTester/RNTester.xctestplan b/packages/rn-tester/RNTester/RNTester.xctestplan index 147173b22f8bc4..788bb59c09c25e 100644 --- a/packages/rn-tester/RNTester/RNTester.xctestplan +++ b/packages/rn-tester/RNTester/RNTester.xctestplan @@ -24,6 +24,7 @@ "identifier" : "13B07F861A680F5B00A75B9A", "name" : "RNTester" }, + "testRepetitionMode" : "retryOnFailure", "undefinedBehaviorSanitizerEnabled" : true }, "testTargets" : [ From ccd2689817c711872695002880825b4bd0f85447 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Tue, 21 May 2024 15:24:12 -0700 Subject: [PATCH 2/2] Remove pipeline retries --- .circleci/configurations/commands.yml | 2 +- .github/actions/test_ios_rntester/action.yml | 2 +- scripts/circleci/run_with_retry.js | 32 -------------------- 3 files changed, 2 insertions(+), 34 deletions(-) delete mode 100755 scripts/circleci/run_with_retry.js diff --git a/.circleci/configurations/commands.yml b/.circleci/configurations/commands.yml index bce934a6b42119..ff9f617c4b6b3a 100644 --- a/.circleci/configurations/commands.yml +++ b/.circleci/configurations/commands.yml @@ -559,7 +559,7 @@ commands: steps: - run: name: "Run Tests: iOS Unit and Integration Tests" - command: node ./scripts/circleci/run_with_retry.js 3 yarn test-ios + command: yarn test-ios - run: name: Zip Derived data folder when: always diff --git a/.github/actions/test_ios_rntester/action.yml b/.github/actions/test_ios_rntester/action.yml index 4a92921c069366..53637a4b0f11b5 100644 --- a/.github/actions/test_ios_rntester/action.yml +++ b/.github/actions/test_ios_rntester/action.yml @@ -127,7 +127,7 @@ runs: - name: "Run Tests: iOS Unit and Integration Tests" if: ${{ inputs.run-unit-tests == true }} shell: bash - run: node ./scripts/circleci/run_with_retry.js 3 yarn test-ios + run: yarn test-ios - name: Zip Derived data folder if: ${{ inputs.run-unit-tests == true }} shell: bash diff --git a/scripts/circleci/run_with_retry.js b/scripts/circleci/run_with_retry.js deleted file mode 100755 index ca81dd81f6abe2..00000000000000 --- a/scripts/circleci/run_with_retry.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @format - */ - -const {retry} = require('./retry'); - -async function retryCommand(maxRetries, command) { - const success = await retry( - command, - {shell: true, stdio: 'inherit'}, - maxRetries, - 0, - ); - if (!success) { - process.exit(1); - } -} - -const maxRetries = process.argv[2]; -const command = process.argv.slice(3).join(' '); - -if (!maxRetries || !command) { - console.log('Usage: node retry_script.js '); - process.exit(1); -} - -retryCommand(maxRetries, command);