Skip to content

Commit

Permalink
java_integration_test#test_header_compilation: use expect_log
Browse files Browse the repository at this point in the history
unzip | grep is known to be flaky and sometimes fails due to some
weird concurrency issue, use expect_log instead, which also display
the log file if the test fails (so remove the line that were showing
the log).

Fixes bazelbuild#2308.

--
PiperOrigin-RevId: 143171057
MOS_MIGRATED_REVID=143171057
  • Loading branch information
damienmg committed Dec 29, 2016
1 parent 6239bc5 commit 45da3f1
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/test/shell/integration/java_integration_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -761,12 +761,10 @@ function test_header_compilation() {

bazel build -s --java_header_compilation=true \
//$pkg/java/main:main || fail "build failed"
echo >&2 "DEBUG[${FUNCNAME[0]}]: start"
unzip -l ${PRODUCT_NAME}-bin/$pkg/java/hello_library/libhello_library-hjar.jar >&2
echo >&2 "DEBUG[${FUNCNAME[0]}]: end"
unzip -l ${PRODUCT_NAME}-bin/$pkg/java/hello_library/libhello_library-hjar.jar \
| grep -q " hello_library/HelloLibrary.class" \
|| fail "missing class file from header compilation"
> $TEST_log
expect_log " hello_library/HelloLibrary.class" \
"missing class file from header compilation"
}

function test_header_compilation_errors() {
Expand Down

0 comments on commit 45da3f1

Please sign in to comment.