aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/test
diff options
context:
space:
mode:
authorGravatar Han-Wen Nienhuys <hanwen@google.com>2015-07-07 11:46:32 +0000
committerGravatar Han-Wen Nienhuys <hanwen@google.com>2015-07-07 16:33:14 +0000
commit2eacd983bb5ff9a28b58a626bf956ed1b113c777 (patch)
tree84e112c448900d1336205e2392478589c9621ad6 /src/main/java/com/google/devtools/build/lib/rules/test
parent130246293c7c36d6538c78e82b59cac343b37c48 (diff)
Support (test) timeouts in Bazel.
Fixes #279. -- MOS_MIGRATED_REVID=97661546
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/test')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/test/StandaloneTestStrategy.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/test/StandaloneTestStrategy.java b/src/main/java/com/google/devtools/build/lib/rules/test/StandaloneTestStrategy.java
index ddea658f5f..a391a30869 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/test/StandaloneTestStrategy.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/test/StandaloneTestStrategy.java
@@ -39,6 +39,7 @@ import com.google.devtools.common.options.OptionsClassProvider;
import java.io.Closeable;
import java.io.IOException;
+import java.util.HashMap;
import java.util.Map;
/**
@@ -76,16 +77,24 @@ public class StandaloneTestStrategy extends TestStrategy {
.getChild(getTmpDirName(action.getExecutionSettings().getExecutable().getExecPath()));
Path workingDirectory = runfilesDir.getRelative(action.getRunfilesPrefix());
+
TestRunnerAction.ResolvedPaths resolvedPaths =
action.resolve(actionExecutionContext.getExecutor().getExecRoot());
Map<String, String> env = getEnv(action, runfilesDir, testTmpDir, resolvedPaths);
+
+ Map<String, String> info = new HashMap<>();
+
+ // This key is only understood by StandaloneSpawnStrategy.
+ info.put("timeout", "" + getTimeout(action));
+ info.putAll(action.getTestProperties().getExecutionInfo());
+
Spawn spawn =
new BaseSpawn(
// Bazel lacks much of the tooling for coverage, so we don't attempt to pass a coverage
// script here.
getArgs(TEST_SETUP, "", action),
env,
- action.getTestProperties().getExecutionInfo(),
+ info,
action,
action
.getTestProperties()