Wire correct interrupt handling from ActionExecutedEvent
Generating command line arguments is an interruptible exercise. This might not
be ideal, but it is what it is. Instead ignoring-ish the interrupt, declare it
in all relevant places up the call stack.
This is primarily signature changes, with the exception of
FileTransport#asStreamProto which returns a null-valued future if the
computation is interrupted. Looking at the documentation and code, this should
be WAI.
PiperOrigin-RevId: 343157405
diff --git a/src/test/java/com/google/devtools/build/lib/runtime/BuildEventStreamerTest.java b/src/test/java/com/google/devtools/build/lib/runtime/BuildEventStreamerTest.java
index efa7952..8980fac 100644
--- a/src/test/java/com/google/devtools/build/lib/runtime/BuildEventStreamerTest.java
+++ b/src/test/java/com/google/devtools/build/lib/runtime/BuildEventStreamerTest.java
@@ -168,7 +168,12 @@
@Override
public synchronized void sendBuildEvent(BuildEvent event) {
events.add(event);
- eventsAsProtos.add(event.asStreamProto(getTestBuildEventContext(this.artifactGroupNamer)));
+ try {
+ eventsAsProtos.add(event.asStreamProto(getTestBuildEventContext(this.artifactGroupNamer)));
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw new IllegalStateException("interrupts not supported in test instance");
+ }
}
@Override
@@ -1404,7 +1409,7 @@
}
@Test
- public void testActionExcutedEventProtoLogs() {
+ public void testActionExcutedEventProtoLogs() throws Exception {
String metadataLogName = "action_metadata";
Path testPath1 = FileSystems.getJavaIoFileSystem().getPath("/path/to/logs-1");
Path testPath2 = FileSystems.getJavaIoFileSystem().getPath("/path/to/logs-2");