Skip to content

Commit 3b939ce

Browse files
authored
test: Retry in the case of network errors (#2606)
# Description This is an attempt to reduce test flakiness. In particular, many tests die due to external network errors. These failures can probably be addressed by retries. Note: This does not attempt to address internal network errors. E.g. port conflicts (I have seen this only ~once~ twice on a random port) or `dfx start` failing to respond to http requests.
1 parent e7b3333 commit 3b939ce

19 files changed

+103
-1
lines changed

.curlrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--retry-max-time 60

.github/workflows/audit.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ concurrency:
1010
group: ${{ github.workflow }}-${{ github.ref }}
1111
cancel-in-progress: true
1212

13+
env:
14+
# When getting Rust dependencies, retry on network error:
15+
CARGO_NET_RETRY: 10
16+
# Use the local .curlrc
17+
CURL_HOME: .
18+
1319
jobs:
1420
build_matrix:
1521
runs-on: ubuntu-latest

.github/workflows/build-frontend-canister.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ on:
66
- master
77
pull_request:
88

9+
env:
10+
# When getting Rust dependencies, retry on network error:
11+
CARGO_NET_RETRY: 10
12+
# Use the local .curlrc
13+
CURL_HOME: .
14+
915
jobs:
1016
frontend:
1117
runs-on: ubuntu-latest

.github/workflows/consistent-sources.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ concurrency:
99
group: ${{ github.workflow }}-${{ github.ref }}
1010
cancel-in-progress: true
1111

12+
env:
13+
# When getting Rust dependencies, retry on network error:
14+
CARGO_NET_RETRY: 10
15+
# Use the local .curlrc
16+
CURL_HOME: .
17+
1218
jobs:
1319
check:
1420
runs-on: ubuntu-latest

.github/workflows/deny.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ concurrency:
1010
group: ${{ github.workflow }}-${{ github.ref }}
1111
cancel-in-progress: true
1212

13+
env:
14+
# When getting Rust dependencies, retry on network error:
15+
CARGO_NET_RETRY: 10
16+
# Use the local .curlrc
17+
CURL_HOME: .
18+
1319
jobs:
1420
cargo-deny:
1521
name: license-check:required

.github/workflows/e2e.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ concurrency:
99
group: ${{ github.workflow }}-${{ github.ref }}
1010
cancel-in-progress: true
1111

12+
env:
13+
# When getting Rust dependencies, retry on network error:
14+
CARGO_NET_RETRY: 10
15+
# Use the local .curlrc
16+
CURL_HOME: .
17+
1218
jobs:
1319
build_dfx:
1420
runs-on: ${{ matrix.os }}

.github/workflows/fmt.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ concurrency:
66
group: ${{ github.workflow }}-${{ github.ref }}
77
cancel-in-progress: true
88

9+
env:
10+
# When getting Rust dependencies, retry on network error:
11+
CARGO_NET_RETRY: 10
12+
# Use the local .curlrc
13+
CURL_HOME: .
14+
915
jobs:
1016
test:
1117
name: fmt

.github/workflows/lint.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ concurrency:
66
group: ${{ github.workflow }}-${{ github.ref }}
77
cancel-in-progress: true
88

9+
env:
10+
# When getting Rust dependencies, retry on network error:
11+
CARGO_NET_RETRY: 10
12+
# Use the local .curlrc
13+
CURL_HOME: .
14+
915
jobs:
1016
test:
1117
name: lint

.github/workflows/motoko-updater.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ concurrency:
1818
group: ${{ github.workflow }}-${{ github.ref }}
1919
cancel-in-progress: true
2020

21+
env:
22+
# When getting Rust dependencies, retry on network error:
23+
CARGO_NET_RETRY: 10
24+
# Use the local .curlrc
25+
CURL_HOME: .
26+
2127
jobs:
2228
niv-updater:
2329
name: 'Check for Motoko updates'

.github/workflows/niv-updater.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ concurrency:
1717
group: ${{ github.workflow }}-${{ github.ref }}
1818
cancel-in-progress: true
1919

20+
env:
21+
# When getting Rust dependencies, retry on network error:
22+
CARGO_NET_RETRY: 10
23+
# Use the local .curlrc
24+
CURL_HOME: .
25+
2026
jobs:
2127
niv-updater:
2228
name: 'Check for updates'

.github/workflows/pr.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ concurrency:
1414
group: ${{ github.workflow }}-${{ github.ref }}
1515
cancel-in-progress: true
1616

17+
env:
18+
# When getting Rust dependencies, retry on network error:
19+
CARGO_NET_RETRY: 10
20+
# Use the local .curlrc
21+
CURL_HOME: .
22+
1723
jobs:
1824
check:
1925
runs-on: ubuntu-latest

.github/workflows/prepare-dfx-assets.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ concurrency:
1212
group: ${{ github.workflow }}-${{ github.ref }}
1313
cancel-in-progress: true
1414

15+
env:
16+
# When getting Rust dependencies, retry on network error:
17+
CARGO_NET_RETRY: 10
18+
# Use the local .curlrc
19+
CURL_HOME: .
20+
1521
jobs:
1622
prepare:
1723
runs-on: ${{ matrix.os }}

.github/workflows/publish-manifest.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ concurrency:
99
group: ${{ github.workflow }}-${{ github.ref }}
1010
cancel-in-progress: true
1111

12+
env:
13+
# When getting Rust dependencies, retry on network error:
14+
CARGO_NET_RETRY: 10
15+
# Use the local .curlrc
16+
CURL_HOME: .
17+
1218
jobs:
1319
publish-manifest:
1420
runs-on: ubuntu-latest

.github/workflows/publish.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ concurrency:
1515
group: ${{ github.workflow }}-${{ github.ref }}
1616
cancel-in-progress: true
1717

18+
env:
19+
# When getting Rust dependencies, retry on network error:
20+
CARGO_NET_RETRY: 10
21+
# Use the local .curlrc
22+
CURL_HOME: .
23+
1824
jobs:
1925
build_dfx:
2026
runs-on: ${{ matrix.os }}

.github/workflows/shellcheck.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ concurrency:
1414
group: ${{ github.workflow }}-${{ github.ref }}
1515
cancel-in-progress: true
1616

17+
env:
18+
# When getting Rust dependencies, retry on network error:
19+
CARGO_NET_RETRY: 10
20+
# Use the local .curlrc
21+
CURL_HOME: .
22+
1723
jobs:
1824
check_macos:
1925
# ubuntu-latest has shellcheck 0.4.6, while macos-latest has 0.7.1

.github/workflows/unit.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ concurrency:
99
group: ${{ github.workflow }}-${{ github.ref }}
1010
cancel-in-progress: true
1111

12+
env:
13+
# When getting Rust dependencies, retry on network error:
14+
CARGO_NET_RETRY: 10
15+
# Use the local .curlrc
16+
CURL_HOME: .
17+
1218
jobs:
1319
test:
1420
runs-on: ${{ matrix.os }}

.github/workflows/update-docs.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ concurrency:
66
group: ${{ github.workflow }}-${{ github.ref }}
77
cancel-in-progress: true
88

9+
env:
10+
# When getting Rust dependencies, retry on network error:
11+
CARGO_NET_RETRY: 10
12+
# Use the local .curlrc
13+
CURL_HOME: .
14+
915
jobs:
1016
update_dfx_json_schema:
1117
runs-on: ${{ matrix.os }}

.github/workflows/update-replica-version.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ concurrency:
2323

2424
env:
2525
IC_RELEASES_API: "https://ic-api.internetcomputer.org/api/v3/subnet-replica-versions?limit=50&offset=0"
26-
26+
# When getting Rust dependencies, retry on network error:
27+
CARGO_NET_RETRY: 10
28+
# Use the local .curlrc
29+
CURL_HOME: .
30+
2731
jobs:
2832
update-replica:
2933
runs-on: ubuntu-latest

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fetch-retries=10

0 commit comments

Comments
 (0)