diff options
author | philwo <philwo@google.com> | 2017-11-23 08:30:07 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2017-11-23 08:33:18 -0800 |
commit | b24a6f96b1e405568eb7895e4242e76fd5bcb719 (patch) | |
tree | 8c9572f73d31bed68e5e60934e15dfdb6c65a762 | |
parent | e14dcc37eb688da8881a782cc689907fd985f0c5 (diff) |
Add regression test for breakage caused by https://github.com/bazelbuild/bazel/commit/0ebb3e54fc890946ae6b3d059ecbd50e4b5ec840.
PiperOrigin-RevId: 176774887
-rwxr-xr-x | src/test/shell/integration/test_test.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/test/shell/integration/test_test.sh b/src/test/shell/integration/test_test.sh index 5a35ababa7..d288fefa17 100755 --- a/src/test/shell/integration/test_test.sh +++ b/src/test/shell/integration/test_test.sh @@ -101,4 +101,31 @@ EOF expect_log 'were skipped' } +# Regression test for b/67463263: Tests that spawn subprocesses must not block +# if those subprocesses never finish. If this test fails, because the "my_test" +# test is timing out, it means that Bazel is waiting for the "sleep" to finish, +# which it shouldn't. +function test_process_spawned_by_test_doesnt_block_test_from_completing() { + mkdir -p dir + + cat > dir/BUILD <<'EOF' +java_test( + name = "my_test", + main_class = "MyTest", + srcs = ["MyTest.java"], + timeout = "short", + use_testrunner = 0, +) +EOF + cat > dir/MyTest.java <<'EOF' +public class MyTest { + public static void main(String[] args) throws Exception { + new ProcessBuilder("sleep", "300").inheritIO().start(); + } +} +EOF + + bazel test //dir:my_test &> $TEST_log || fail "expected test to pass" +} + run_suite "test tests" |