diff --git a/src/main/java/com/google/devtools/build/lib/exec/StandaloneTestStrategy.java b/src/main/java/com/google/devtools/build/lib/exec/StandaloneTestStrategy.java index 43e72787d289c8..cc483672c9d046 100644 --- a/src/main/java/com/google/devtools/build/lib/exec/StandaloneTestStrategy.java +++ b/src/main/java/com/google/devtools/build/lib/exec/StandaloneTestStrategy.java @@ -465,7 +465,9 @@ private Spawn createXmlGeneratingSpawn(TestRunnerAction action, SpawnResult resu "TEST_TOTAL_SHARDS", Integer.toString(action.getExecutionSettings().getTotalShards()), "TEST_NAME", action.getTestName(), "TEST_BINARY", testBinaryName), - ImmutableMap.of(), + // Pass the execution info of the action which is identical to the supported tags set on the + // test target. In particular, this does not set the test timeout on the spawn. + ImmutableMap.copyOf(action.getExecutionInfo()), null, ImmutableMap.of(), /*inputs=*/ ImmutableList.of(action.getTestXmlGeneratorScript(), action.getTestLog()), diff --git a/src/test/java/com/google/devtools/build/lib/exec/StandaloneTestStrategyTest.java b/src/test/java/com/google/devtools/build/lib/exec/StandaloneTestStrategyTest.java index 771958614fb948..219d89e041e650 100644 --- a/src/test/java/com/google/devtools/build/lib/exec/StandaloneTestStrategyTest.java +++ b/src/test/java/com/google/devtools/build/lib/exec/StandaloneTestStrategyTest.java @@ -519,6 +519,7 @@ public void testThatTestLogAndOutputAreReturnedWithSplitXmlGeneration() throws E " name = \"failing_test\",", " size = \"small\",", " srcs = [\"failing_test.sh\"],", + " tags = [\"local\"],", ")"); TestRunnerAction testRunnerAction = getTestAction("//standalone:failing_test"); @@ -538,6 +539,8 @@ public void testThatTestLogAndOutputAreReturnedWithSplitXmlGeneration() throws E .thenAnswer( (invocation) -> { Spawn spawn = invocation.getArgument(0); + // Test that both spawns have the local tag attached as a execution info + assertThat(spawn.getExecutionInfo()).containsKey("local"); ActionExecutionContext context = invocation.getArgument(1); FileOutErr outErr = context.getFileOutErr(); called.add(outErr);