Add test for bazel server shutdown/restart
We recently had an issue where the bazel server
couldn't be shutdown/restart because it was being
run in a docker container with a PID 1 that wasn't
capable of reaping zombie processes.
Bug: 234449134
Test: abtd run of this test because it's not run on presubmit
Change-Id: I1e179902364ea84fd55003389f3045de2e998991
diff --git a/tests/b_tests.sh b/tests/b_tests.sh
index 45cb4f7..13f156d 100755
--- a/tests/b_tests.sh
+++ b/tests/b_tests.sh
@@ -27,6 +27,10 @@
b build "$test_target" --run-soong-tests
b build --run-soong-tests "$test_target"
b --run-soong-tests build "$test_target"
+# Test that the bazel server can be restarted once shut down. If run in a
+# docker container, you need to run the docker container with --init or
+# have some other process as PID 1 that can reap zombies.
+b shutdown
b cquery 'kind(test, //build/bazel/examples/android_app/...)' --config=android
b run $test_target -- --help >/dev/null