]> gitweb.fluxo.info Git - puppet-sshkeys_core.git/commitdiff
(maint) Adds retries to nightly gem tests
authorMichael Hashizume <michael.hashizume@puppet.com>
Thu, 13 Jan 2022 21:56:03 +0000 (13:56 -0800)
committerBobosila Victor <vbobosila1@gmail.com>
Fri, 14 Jan 2022 14:01:03 +0000 (16:01 +0200)
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

.github/workflows/dispatch_unit_tests_with_nightly_puppet_gem.yaml
.github/workflows/unit_tests_with_nightly_puppet_gem.yaml

index 6df39565425719258651ef6b25ac76dfb97820d9..b8a15f1ef625fe37a5d61a1929808f770f8406ca 100644 (file)
@@ -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: |
index 2ea5e91040e824ed7bb89558c0c0786b39dd0d67..206e1de3f4eed16dffdc13ef2203d90348552d36 100644 (file)
@@ -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: |