From cfcffc7dd2f6191dc59d0256587bf5b57a8bb1a2 Mon Sep 17 00:00:00 2001 From: Michael Hashizume Date: Thu, 13 Jan 2022 13:56:03 -0800 Subject: (maint) Adds retries to nightly gem tests We've had periodic failures in tests using the nightly gem, potentially due to timing issues. This adds a simple shell loop to retry downloading and installing the nightly gem. See also: 6de6c971588905e586b71e2f77527380a6f52163 --- .../dispatch_unit_tests_with_nightly_puppet_gem.yaml | 13 +++++++++++-- .github/workflows/unit_tests_with_nightly_puppet_gem.yaml | 13 +++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/.github/workflows/dispatch_unit_tests_with_nightly_puppet_gem.yaml b/.github/workflows/dispatch_unit_tests_with_nightly_puppet_gem.yaml index 6df3956..b8a15f1 100644 --- a/.github/workflows/dispatch_unit_tests_with_nightly_puppet_gem.yaml +++ b/.github/workflows/dispatch_unit_tests_with_nightly_puppet_gem.yaml @@ -103,8 +103,17 @@ jobs: - name: Install the latest nightly build of puppet${{ env.puppet_version }} gem run: | - curl http://nightlies.puppet.com/downloads/gems/puppet${{ env.puppet_version }}-nightly/puppet-${{ needs.set_output_data.outputs.puppet_short_commit }}${{ matrix.gem_file_postfix }} --output puppet.gem - gem install puppet.gem -N + sleep_time=0 + until [ $sleep_time -ge 15 ] + do + curl --location http://nightlies.puppet.com/downloads/gems/puppet${{ matrix.puppet_version }}-nightly/${{ matrix.gem_file }} --output puppet.gem + gem install puppet.gem -N && break + + sleep_time=$((sleep_time*2+1)) + echo "Retrying download and install of gem in $sleep_time seconds..." + sleep $sleep_time + done + shell: bash - name: Prepare testing environment with bundler run: | diff --git a/.github/workflows/unit_tests_with_nightly_puppet_gem.yaml b/.github/workflows/unit_tests_with_nightly_puppet_gem.yaml index 2ea5e91..206e1de 100644 --- a/.github/workflows/unit_tests_with_nightly_puppet_gem.yaml +++ b/.github/workflows/unit_tests_with_nightly_puppet_gem.yaml @@ -45,8 +45,17 @@ jobs: - name: Install the latest nightly build of puppet${{ matrix.puppet_version }} gem run: | - curl http://nightlies.puppet.com/downloads/gems/puppet${{ matrix.puppet_version }}-nightly/${{ matrix.gem_file }} --output puppet.gem - gem install puppet.gem -N + sleep_time=0 + until [ $sleep_time -ge 15 ] + do + curl --location http://nightlies.puppet.com/downloads/gems/puppet${{ matrix.puppet_version }}-nightly/${{ matrix.gem_file }} --output puppet.gem + gem install puppet.gem -N && break + + sleep_time=$((sleep_time*2+1)) + echo "Retrying download and install of gem in $sleep_time seconds..." + sleep $sleep_time + done + shell: bash - name: Prepare testing environment with bundler run: | -- cgit v1.2.3