diff options
author | 2017-09-29 05:06:02 -0400 | |
---|---|---|
committer | 2017-09-29 12:14:37 -0400 | |
commit | 182419569f790ec4674aa1799fe7c11d537f6384 (patch) | |
tree | c78344cca27fff962591b35462f0b8663d01f3e2 | |
parent | 1bd6733e9319c053fe026329250d67503fad28c5 (diff) |
Windows, sh tests: fix corrupt installation error
Fixes https://github.com/bazelbuild/bazel/issues/3618
Change-Id: I1533088d4d51dc0510de5cd5b392edec95458057
PiperOrigin-RevId: 170458069
-rwxr-xr-x | src/test/shell/testenv.sh | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/test/shell/testenv.sh b/src/test/shell/testenv.sh index cb4f275f1c..1c2313fdee 100755 --- a/src/test/shell/testenv.sh +++ b/src/test/shell/testenv.sh @@ -289,6 +289,12 @@ esac # OS X has a limit in the pipe length, so force the root to a shorter one bazel_root="${TEST_TMPDIR}/root" + +# Delete stale installation directory from previously failed tests. On Windows +# we regularly get the same TEST_TMPDIR but a failed test may only partially +# clean it up, and the next time the test runs, Bazel reports a corrupt +# installation error. See https://github.com/bazelbuild/bazel/issues/3618 +rm -rf "${bazel_root}" mkdir -p "${bazel_root}" bazel_javabase="${jdk_dir}" @@ -463,10 +469,10 @@ function cleanup() { break fi if (( i == 10 )) || (( i == 30 )) || (( i == 60 )) ; then - echo "Test cleanup: couldn't delete ${BAZEL_INSTALL_BASE} \ after $i seconds" + echo "Test cleanup: couldn't delete ${BAZEL_INSTALL_BASE} after $i seconds" echo "(Timeout in $((120-i)) seconds.)" - sleep 1 fi + sleep 1 done fi } |