aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/shell/testenv.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/shell/testenv.sh')
-rwxr-xr-xsrc/test/shell/testenv.sh10
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
}