diff options
author | dmarting <dmarting@google.com> | 2017-05-05 15:52:57 +0200 |
---|---|---|
committer | Damien Martin-Guillerez <dmarting@google.com> | 2017-05-05 18:36:51 +0200 |
commit | 0e8997c2510151d8b299ba72aad4d0d3599983a7 (patch) | |
tree | ed97e56d84f9fc478895b51256930ceb1c413007 /src/test/shell | |
parent | d74bf36232fbb1950eba32886d153767b3b9b177 (diff) |
Cat the jvm.log if present
Issue like #2939 are impossible to debug due to missing
jvm.log, make the test framework print it before dying if
the error log output the jvm.log
Fixes #2939 (at least the part we can act on).
PiperOrigin-RevId: 155192458
Diffstat (limited to 'src/test/shell')
-rw-r--r-- | src/test/shell/unittest.bash | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/shell/unittest.bash b/src/test/shell/unittest.bash index 88e1617700..ed2b7c5aa1 100644 --- a/src/test/shell/unittest.bash +++ b/src/test/shell/unittest.bash @@ -103,6 +103,14 @@ function disable_errexit() { # Enable errexit with pretty stack traces. enable_errexit +cat_jvm_log () { + if [[ "$log_content" =~ "(error code:".*", error message: '".*"', log file: '"(.*)"')" ]]; then + echo >&2 + echo "Content of ${BASH_REMATCH[1]}:" >&2 + cat "${BASH_REMATCH[1]}" >&2 + fi +} + # Print message in "$1" then exit with status "$2" die () { # second argument is optional, defaulting to 1 @@ -116,6 +124,7 @@ die () { fi if [ "$CAPTURED_STD_ERR" -ne 0 ]; then cat "${TEST_TMPDIR}/captured.err" 1>&2 + cat_jvm_log "$(cat "${TEST_TMPDIR}/captured.err")" CAPTURED_STD_ERR=0 fi fi |