aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Hashizume <michael.hashizume@puppet.com>2022-01-13 13:56:03 -0800
committerBobosila Victor <vbobosila1@gmail.com>2022-01-14 16:01:03 +0200
commitcfcffc7dd2f6191dc59d0256587bf5b57a8bb1a2 (patch)
tree0e01d011067e59a79c37e8f11496bfe85da63e3f
parentbc16ad7370893d68ca9f922dba4461a53b82e894 (diff)
downloadpuppet-sshkeys_core-cfcffc7dd2f6191dc59d0256587bf5b57a8bb1a2.tar.gz
puppet-sshkeys_core-cfcffc7dd2f6191dc59d0256587bf5b57a8bb1a2.tar.bz2
(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
-rw-r--r--.github/workflows/dispatch_unit_tests_with_nightly_puppet_gem.yaml13
-rw-r--r--.github/workflows/unit_tests_with_nightly_puppet_gem.yaml13
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: |