Skip to content

Commit 1bd7334

Browse files
Merge pull request #60 from mhashizume/maint/nightly_gem_workflows
(maint) Adds retries to nightly gem tests
2 parents bc16ad7 + cfcffc7 commit 1bd7334

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

.github/workflows/dispatch_unit_tests_with_nightly_puppet_gem.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,17 @@ jobs:
103103

104104
- name: Install the latest nightly build of puppet${{ env.puppet_version }} gem
105105
run: |
106-
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
107-
gem install puppet.gem -N
106+
sleep_time=0
107+
until [ $sleep_time -ge 15 ]
108+
do
109+
curl --location http://nightlies.puppet.com/downloads/gems/puppet${{ matrix.puppet_version }}-nightly/${{ matrix.gem_file }} --output puppet.gem
110+
gem install puppet.gem -N && break
111+
112+
sleep_time=$((sleep_time*2+1))
113+
echo "Retrying download and install of gem in $sleep_time seconds..."
114+
sleep $sleep_time
115+
done
116+
shell: bash
108117

109118
- name: Prepare testing environment with bundler
110119
run: |

.github/workflows/unit_tests_with_nightly_puppet_gem.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,17 @@ jobs:
4545

4646
- name: Install the latest nightly build of puppet${{ matrix.puppet_version }} gem
4747
run: |
48-
curl http://nightlies.puppet.com/downloads/gems/puppet${{ matrix.puppet_version }}-nightly/${{ matrix.gem_file }} --output puppet.gem
49-
gem install puppet.gem -N
48+
sleep_time=0
49+
until [ $sleep_time -ge 15 ]
50+
do
51+
curl --location http://nightlies.puppet.com/downloads/gems/puppet${{ matrix.puppet_version }}-nightly/${{ matrix.gem_file }} --output puppet.gem
52+
gem install puppet.gem -N && break
53+
54+
sleep_time=$((sleep_time*2+1))
55+
echo "Retrying download and install of gem in $sleep_time seconds..."
56+
sleep $sleep_time
57+
done
58+
shell: bash
5059

5160
- name: Prepare testing environment with bundler
5261
run: |

0 commit comments

Comments
 (0)