Skip to content

Commit a27836c

Browse files
authored
Merge pull request #2481 from shiftstack/concurrent-e2e-error-logging
Fix logging when e2e prerequisites build fails
2 parents 1e5698d + 26078c9 commit a27836c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

scripts/ci-e2e.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ if [ -n "${BOSKOS_HOST:-}" ]; then
8181
fi
8282

8383
# Run e2e prerequisites concurrently with devstack build to save time
84-
build_out=$(mktemp)
84+
prerequisites_log="${ARTIFACTS}/logs/e2e-prerequisites.log"
8585
(
8686
# Run prerequisites at low priority to avoid slowing down devstack tasks,
8787
# which generally take much longer
@@ -101,18 +101,18 @@ build_out=$(mktemp)
101101
retry 10 10 $(get_ssh_cmd) ${CONTROLLER_IP} -- sudo chown root:root capo-e2e-image.tar
102102
retry 10 10 $(get_ssh_cmd) ${CONTROLLER_IP} -- sudo chmod u=rw,g=r,o=r capo-e2e-image.tar
103103
retry 10 10 $(get_ssh_cmd) ${CONTROLLER_IP} -- sudo mv capo-e2e-image.tar /var/www/html/capo-e2e-image.tar
104-
) >"$build_out" 2>&1 &
104+
) >"$prerequisites_log" 2>&1 &
105105
build_pid=$!
106106

107107
# Build the devstack environment
108108
hack/ci/create_devstack.sh
109109

110-
# Wait for and capture exit of build process
111-
# Log build output and exit if the build failed
112-
wait $build_pid
113-
ret=$?
114-
cat "$build_out"
115-
[ "$ret" != 0 ] && exit "$ret"
110+
# Check exit of prerequisites build, waiting for it to complete if necessary
111+
if ! wait $build_pid; then
112+
echo "Building e2e prerequisites failed"
113+
cat "$prerequisites_log"
114+
exit 1
115+
fi
116116

117117
make test-e2e OPENSTACK_CLOUD_YAML_FILE="$(pwd)/clouds.yaml"
118118
test_status="${?}"

0 commit comments

Comments
 (0)