diff --git a/src/test/java/com/google/devtools/build/lib/worker/BUILD b/src/test/java/com/google/devtools/build/lib/worker/BUILD index e488d2b9e44024..01288ea5da9330 100644 --- a/src/test/java/com/google/devtools/build/lib/worker/BUILD +++ b/src/test/java/com/google/devtools/build/lib/worker/BUILD @@ -162,10 +162,6 @@ java_test( java_test( name = "WorkRequestHandlerTest", srcs = ["WorkRequestHandlerTest.java"], - jvm_flags = [ - # TODO: b/222158599 - GoogleTestSecurityManager is being turned down - "-Dcom.google.testing.junit.runner.shouldInstallTestSecurityManager=true", - ], deps = [ "//src/main/java/com/google/devtools/build/lib/worker:work_request_handlers", "//src/main/protobuf:worker_protocol_java_proto", diff --git a/src/test/java/com/google/devtools/build/lib/worker/WorkRequestHandlerTest.java b/src/test/java/com/google/devtools/build/lib/worker/WorkRequestHandlerTest.java index 9c1ea29fab7c8a..a9624be7cec450 100644 --- a/src/test/java/com/google/devtools/build/lib/worker/WorkRequestHandlerTest.java +++ b/src/test/java/com/google/devtools/build/lib/worker/WorkRequestHandlerTest.java @@ -37,6 +37,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import org.junit.After; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @@ -120,14 +121,14 @@ public void testMultiplexWorkRequest_stopsThreadsOnShutdown() new WorkRequestHandler( (args, err) -> { // Each call to this runs in its own thread. + synchronized (workerThreads) { + workerThreads.add(Thread.currentThread()); + } + started.release(); try { - synchronized (workerThreads) { - workerThreads.add(Thread.currentThread()); - } - started.release(); - eternity.acquire(); // This blocks forever. + eternity.acquire(); // This blocks until the thread is interrupted at shutdown. } catch (InterruptedException e) { - throw new AssertionError("Unhandled exception", e); + Thread.currentThread().interrupt(); } return 0; }, @@ -165,6 +166,7 @@ public void testMultiplexWorkRequest_stopsThreadsOnShutdown() } @Test + @Ignore("b/380340632 - test currently relies on GoogleTestSecurityManager") public void testMultiplexWorkRequest_stopsWorkerOnException() throws IOException, InterruptedException { PipedOutputStream src = new PipedOutputStream();