aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/shell/bazel
diff options
context:
space:
mode:
authorGravatar Philipp Wollermann <philwo@google.com>2016-03-09 22:09:14 +0000
committerGravatar David Chen <dzc@google.com>2016-03-10 10:22:37 +0000
commitbe7176811f77dd58de763c7ac24d5fb7f849c5c0 (patch)
treedbdcea753c8f86269e89bb38097716a9e19cba6c /src/test/shell/bazel
parent4e4ffd2778fdad30c16384872fe6a92f5355f43f (diff)
Make the bazel_worker_test non-flaky, once and for all.
-- MOS_MIGRATED_REVID=116801400
Diffstat (limited to 'src/test/shell/bazel')
-rwxr-xr-xsrc/test/shell/bazel/bazel_worker_test.sh37
1 files changed, 1 insertions, 36 deletions
diff --git a/src/test/shell/bazel/bazel_worker_test.sh b/src/test/shell/bazel/bazel_worker_test.sh
index 229d4ba033..61ee9eafc4 100755
--- a/src/test/shell/bazel/bazel_worker_test.sh
+++ b/src/test/shell/bazel/bazel_worker_test.sh
@@ -27,24 +27,7 @@ source $(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/test-setup.sh \
example_worker=$(find $TEST_SRCDIR -name ExampleWorker_deploy.jar)
function set_up() {
- workers=$(print_workers)
- if [[ ! -z "${workers}" ]]; then
- kill $workers
-
- # Wait at most 10 seconds for all workers to shut down.
- for i in 0 1 2 3 4 5 6 7 8 9; do
- still_running_workers=$(for pid in $workers; do kill -0 $pid &>/dev/null && echo $pid || true; done)
-
- if [[ ! -z "${still_running_workers}" ]]; then
- if [[ $i -eq 3 ]]; then
- kill -TERM $still_running_workers
- fi
-
- sleep 1
- fi
- done
- fi
-
+ bazel build --worker_quit_after_build
assert_workers_not_running
}
@@ -90,23 +73,6 @@ function print_workers() {
pgrep -P $pid || true
}
-function shutdown_and_print_unkilled_workers() {
- workers=$(print_workers)
- bazel shutdown || fail "shutdown failed"
-
- # Wait at most 10 seconds for all workers to shut down, then print the remaining (if any).
- for i in 0 1 2 3 4 5 6 7 8 9; do
- still_running_workers=$(for pid in $workers; do kill -0 $pid &>/dev/null && echo $pid || true; done)
- if [[ ! -z "${still_running_workers}" ]]; then
- sleep 1
- fi
- done
-
- if [ ! -z "$still_running_workers" ]; then
- fail "Worker processes were still running after shutdown: ${unkilled_workers}"
- fi
-}
-
function assert_workers_running() {
workers=$(print_workers)
if [[ -z "${workers}" ]]; then
@@ -128,7 +94,6 @@ function test_compiles_hello_library_using_persistent_javac() {
bazel-bin/java/main/main | grep -q "Hello, Library!;Hello, World!" \
|| fail "comparison failed"
assert_workers_running
- shutdown_and_print_unkilled_workers
}
function test_workers_quit_after_build() {