File tree Expand file tree Collapse file tree 5 files changed +27
-15
lines changed Expand file tree Collapse file tree 5 files changed +27
-15
lines changed Original file line number Diff line number Diff line change @@ -6,9 +6,7 @@ trap "echo '** AT LEAST ONE OF TESTS FAILED **'" ERR
6
6
# Fail on any error, show commands run.
7
7
set -eox pipefail
8
8
9
- retry () {
10
- " ${@ } " || " ${@ } " || " ${@ } " || exit $?
11
- }
9
+ . $( dirname $0 ) /../tools/retry.sh
12
10
13
11
cd $( dirname $0 )
14
12
Original file line number Diff line number Diff line change 2
2
3
3
trap " echo '** TEST FAILED **'" ERR
4
4
5
- retry () {
6
- " ${@ } " || " ${@ } " || " ${@ } " || return 1
7
- }
5
+ . $( dirname $0 ) /../tools/retry.sh
8
6
9
7
function timeout_after() {
10
8
# timeout on Node 11 alpine image requires -t to specify time.
Original file line number Diff line number Diff line change 14
14
# See the License for the specific language governing permissions and
15
15
# limitations under the License.
16
16
17
- retry () {
18
- " ${@ } " || " ${@ } " || " ${@ } " || exit $?
19
- }
17
+ . $( dirname $0 ) /../retry.sh
20
18
21
19
# Fail on any error.
22
20
set -e pipefail
Original file line number Diff line number Diff line change 13
13
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
14
# See the License for the specific language governing permissions and
15
15
# limitations under the License.
16
- retry () {
17
- for i in {1..3}; do
18
- " ${@ } " && return 0
19
- done
20
- return 1
21
- }
16
+
17
+ . $( dirname $0 ) /retry.sh
22
18
23
19
set -eo pipefail
24
20
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ retry () {
17
+ for attempt in {1..3}; do
18
+ [ $attempt == 1 ] || sleep 10 # Backing off after a failed attempt.
19
+ " ${@ } " && return 0
20
+ done
21
+ return 1
22
+ }
You can’t perform that action at this time.
0 commit comments