Skip to content

Commit 87c8481

Browse files
committed
chore: retry npm install in system test when command hangs
1 parent ff5bc21 commit 87c8481

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

system-test/test.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ retry() {
66
"${@}" || "${@}" || "${@}" || return 1
77
}
88

9+
npm_install() {
10+
timeout 60 npm install "${@}"
11+
}
12+
913
set -eox pipefail
1014
cd $(dirname $0)/..
1115

@@ -16,9 +20,9 @@ NODEDIR=$(dirname $(dirname $(which node)))
1620
# contains unreleased fixes that allow the native component to be compiled
1721
# with Node's V8 canary build.
1822
[ -z $NVM_NODEJS_ORG_MIRROR ] \
19-
|| retry npm install https://github.com/nodejs/nan.git
23+
|| retry npm_install https://github.com/nodejs/nan.git
2024

21-
retry npm install --nodedir="$NODEDIR" \
25+
retry npm_install --nodedir="$NODEDIR" \
2226
${BINARY_HOST:+--pprof_binary_host_mirror=$BINARY_HOST} >/dev/null
2327

2428
npm run compile
@@ -30,8 +34,8 @@ TESTDIR=$(mktemp -d)
3034
cp -r "$PWD/system-test/busybench" "$TESTDIR"
3135
cd "$TESTDIR/busybench"
3236

33-
retry npm install pify @types/pify typescript gts @types/node >/dev/null
34-
retry npm install --nodedir="$NODEDIR" \
37+
retry npm_install pify @types/pify typescript gts @types/node >/dev/null
38+
retry npm_install --nodedir="$NODEDIR" \
3539
${BINARY_HOST:+--pprof_binary_host_mirror=$BINARY_HOST} \
3640
"$PROFILER">/dev/null
3741

0 commit comments

Comments
 (0)