Skip to content

Commit

Permalink
ci: fix frequent nightly build failure in CI determining latest_edge_…
Browse files Browse the repository at this point in the history
…version (#2298)

Piping a curl download into commands that close the read pipe before
curl has fully downloaded the file (per a Context-Length header) will
result in curl erroring out with "Failed writing body". This breaks this 
script, because it is running with 'set -o pipefail'.

An attempt to use a local temp file was discarded because of a
not understood failure in CI. See #2296 comments.

Fixes: #2296
  • Loading branch information
trentm authored Aug 25, 2021
1 parent e1a9a79 commit c44cedb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .ci/scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ else
fi

# Turn on xtrace output only after processing args.
set -x
export PS4='${BASH_SOURCE}:${LINENO}: ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
set -o xtrace


# ---- For nightly and rc builds, determine if there is a point in testing.
Expand All @@ -144,8 +145,9 @@ if [[ $BUILD_TYPE != "release" && $FORCE != "true" ]]; then
#
# Note: We are relying on new releases being added to the top of index.tab,
# which currently seems to be the case.
latest_edge_version=$(curl -sS ${NVM_NODEJS_ORG_MIRROR}/index.tab \
| (grep "^v${NODE_VERSION}" || true) | awk '{print $1}' | head -1)
index_tab_content=$(curl -sS "${NVM_NODEJS_ORG_MIRROR}/index.tab" \
| (grep "^v${NODE_VERSION}" || true) | awk '{print $1}')
latest_edge_version=$(echo "$index_tab_content" | head -1)
if [[ -z "$latest_edge_version" ]]; then
skip "No ${BUILD_TYPE} build of Node v${NODE_VERSION} was found. Skipping tests."
fi
Expand Down

0 comments on commit c44cedb

Please sign in to comment.