Skip to content

Commit

Permalink
[7.1.0] Make SpawnLogContext interruptible. (#21337)
Browse files Browse the repository at this point in the history
To simplify a followup change.

PiperOrigin-RevId: 606551475
Change-Id: I1a6b32352fce3beeb4f903079a50f6a5429d44d6
  • Loading branch information
tjgq authored Feb 13, 2024
1 parent 2ce2960 commit 579ee71
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public abstract void logSpawn(
FileSystem fileSystem,
Duration timeout,
SpawnResult result)
throws IOException, ExecException;
throws IOException, InterruptedException, ExecException;

/** Finishes writing the log and performs any required post-processing. */
public abstract void close() throws IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public void testTransitiveNestedSet(@TestParameter InputsMode inputsMode) throws

@Override
protected SpawnLogContext createSpawnLogContext(ImmutableMap<String, String> platformProperties)
throws IOException {
throws IOException, InterruptedException {
RemoteOptions remoteOptions = Options.getDefaults(RemoteOptions.class);
remoteOptions.remoteDefaultExecProperties = platformProperties.entrySet().asList();

Expand All @@ -113,7 +113,7 @@ protected SpawnLogContext createSpawnLogContext(ImmutableMap<String, String> pla

@Override
protected void closeAndAssertLog(SpawnLogContext context, SpawnExec... expected)
throws IOException {
throws IOException, InterruptedException {
context.close();

ArrayList<SpawnExec> actual = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public final class ExpandedSpawnLogContextTest extends SpawnLogContextTestBase {

@Override
protected SpawnLogContext createSpawnLogContext(ImmutableMap<String, String> platformProperties)
throws IOException {
throws IOException, InterruptedException {
RemoteOptions remoteOptions = Options.getDefaults(RemoteOptions.class);
remoteOptions.remoteDefaultExecProperties = platformProperties.entrySet().asList();

Expand All @@ -54,7 +54,7 @@ protected SpawnLogContext createSpawnLogContext(ImmutableMap<String, String> pla

@Override
protected void closeAndAssertLog(SpawnLogContext context, SpawnExec... expected)
throws IOException {
throws IOException, InterruptedException {
context.close();

ArrayList<SpawnExec> actual = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -957,12 +957,12 @@ protected static TreeArtifactValue createTreeArtifactValue(Artifact tree) throws
return builder.build();
}

protected SpawnLogContext createSpawnLogContext() throws IOException {
protected SpawnLogContext createSpawnLogContext() throws IOException, InterruptedException {
return createSpawnLogContext(ImmutableSortedMap.of());
}

protected abstract SpawnLogContext createSpawnLogContext(
ImmutableMap<String, String> platformProperties) throws IOException;
ImmutableMap<String, String> platformProperties) throws IOException, InterruptedException;

protected Digest getDigest(String content) {
return Digest.newBuilder()
Expand All @@ -982,5 +982,5 @@ protected static void writeFile(Path path, String contents) throws IOException {
}

protected abstract void closeAndAssertLog(SpawnLogContext context, SpawnExec... expected)
throws IOException;
throws IOException, InterruptedException;
}

0 comments on commit 579ee71

Please sign in to comment.