aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/exec/StandaloneTestStrategy.java
diff options
context:
space:
mode:
authorGravatar Ulf Adams <ulfjack@google.com>2017-03-02 17:32:28 +0000
committerGravatar Yue Gan <yueg@google.com>2017-03-03 10:36:39 +0000
commitcddaaa66b9aac7c4ea4772ae2a23b97426d267c2 (patch)
treeeb018b744eff97144ccc2fb3850dfc184b907236 /src/main/java/com/google/devtools/build/lib/exec/StandaloneTestStrategy.java
parent64f3eb0492f675d0e4713989f2bdd175ff078758 (diff)
Rationalize local resource acquisition
Move all local resource acquisition to where local execution actually happens. Don't attempt to acquire resources per action, but only for individual spawns. This significantly simplifies the code. The downside is that we don't account for action-level work anymore. In general, actions should not perform any process execution themselves, but always delegate such work to a SpawnStrategy implementation. This change makes sure that every Spawn has local resources set in a way that is consistent with the previous state. However, there are two actions - Fileset and FileWrite -, which are not spawns, and so we now don't limit their concurrent execution anymore. For Fileset, all work is done in a custom Fileset-specific thread pool, so this shouldn't be a problem. I'm not sure about FileWriteAction. -- PiperOrigin-RevId: 149012600 MOS_MIGRATED_REVID=149012600
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/exec/StandaloneTestStrategy.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/exec/StandaloneTestStrategy.java8
1 files changed, 1 insertions, 7 deletions
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 0a1ff9777c..7e862d64ce 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
@@ -23,9 +23,6 @@ import com.google.devtools.build.lib.actions.EnvironmentalExecException;
import com.google.devtools.build.lib.actions.ExecException;
import com.google.devtools.build.lib.actions.ExecutionStrategy;
import com.google.devtools.build.lib.actions.Executor;
-import com.google.devtools.build.lib.actions.ResourceManager;
-import com.google.devtools.build.lib.actions.ResourceManager.ResourceHandle;
-import com.google.devtools.build.lib.actions.ResourceSet;
import com.google.devtools.build.lib.actions.Spawn;
import com.google.devtools.build.lib.actions.SpawnActionContext;
import com.google.devtools.build.lib.actions.TestExecException;
@@ -246,13 +243,10 @@ public class StandaloneTestStrategy extends TestStrategy {
Path workingDirectory)
throws IOException, ExecException, InterruptedException {
prepareFileSystem(action, tmpDir, coverageDir, workingDirectory);
- ResourceSet resources =
- action.getTestProperties().getLocalResourceUsage(executionOptions.usingLocalTestJobs());
try (FileOutErr fileOutErr =
new FileOutErr(
- action.getTestLog().getPath(), action.resolve(execRoot).getTestStderr());
- ResourceHandle handle = ResourceManager.instance().acquireResources(action, resources)) {
+ action.getTestLog().getPath(), action.resolve(execRoot).getTestStderr())) {
TestResultData data =
executeTest(
action,