Skip to content

Commit

Permalink
Trap CI test errors with their original exit codes
Browse files Browse the repository at this point in the history
Currently, each time an error occurs the CI test script will only trap
the error code an switch it to a code `1` which is not representative of
the underlying error that occurred. This makes it a bit difficult to
identify the source of the error, particularly in cases where the test
times out (exit code `124`) and there's no summary in the log.

This change captures and prints the last error code upon exit, but also
logs all errors that may have occurred throughout execution where they
occurred, thus facilitating debugging.
  • Loading branch information
pentschev committed Apr 3, 2024
1 parent 4208768 commit af7a3a5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ci/test_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ rapids-logger "Check GPU usage"
nvidia-smi

EXITCODE=0
trap "EXITCODE=1" ERR
set_exit_code() {
EXITCODE=$?
rapids-logger "Test failed with error ${EXITCODE}"
}
trap set_exit_code ERR
set +e

rapids-logger "pytest dask-cuda"
Expand Down Expand Up @@ -71,5 +75,5 @@ python dask_cuda/benchmarks/local_cudf_shuffle.py \
--runs 1 \
--backend explicit-comms

rapids-logger "Test script exiting with value: $EXITCODE"
rapids-logger "Test script exiting with latest error code: $EXITCODE"
exit ${EXITCODE}

0 comments on commit af7a3a5

Please sign in to comment.