From f66dcab89f33a9e7d6f301296d140afd25e5054b Mon Sep 17 00:00:00 2001 From: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Date: Wed, 3 Feb 2021 14:59:17 -0800 Subject: [PATCH] Try to install the SDK up to 3 times (#30742) Summary: The windows CI tests are flaky due to network failures trying to install the android SDK. This modifies the CI to retry a couple of times if the first install fails. CircleCI will timeout the command if there is no output to the console for 10mins. I've added a timeout to the choco command for 9mins, which should cause it to timeout before the circleci one (assuming that it spends a non-zero time with output before hanging on the download) On successful downloads runs the download seems to be substantially quicker than the 10min timeout. I added --force and --forcedependencies on the retries, otherwise if the jdk package fails, but the androidsdk package installs, the retry will still not install the jdk package. This doesn't fully fix the issue, since the CI is still hitting the network, which could be flaky all 3 attempts. But hopefully it'll improve the success rate somewhat. -- Really the Windows CI job should have some kind of docker image or something that already has all the prereqs installed. ## Changelog [Internal] [Fixed] - Windows CI Android SDK install retry Pull Request resolved: https://github.com/facebook/react-native/pull/30742 Test Plan: We'll see if the windows CI becomes more reliable Reviewed By: fkgozali Differential Revision: D26231499 Pulled By: hramos fbshipit-source-id: f4a7f2132b3317f4763ddadcd909ef1c2a43dc2f --- .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 49c0c6603f4051..321d7fb854a8ef 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -639,9 +639,11 @@ jobs: paths: - C:\Users\circleci\AppData\Local\Yarn + # Try to install the SDK up to 3 times, since network flakiness can cause install failures + # Using a timeout of 9 mins, as circle ci will timeout if there is no output for 10 mins - run: name: Install Android SDK Tools - command: choco install android-sdk + command: choco install android-sdk --timeout 540; if (!$?) { choco install android-sdk --timeout 540 --force --forcedependencies}; if (!$?) { choco install android-sdk --force --forcedependencies} - run: name: Setup Android SDKs