diff options
Diffstat (limited to 'src/main/java/com/google/devtools')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/exec/StandaloneTestStrategy.java | 5 | ||||
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/exec/TestStrategy.java | 9 |
2 files changed, 13 insertions, 1 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 e74de60aa3..7675da16eb 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 @@ -100,7 +100,10 @@ public class StandaloneTestStrategy extends TestStrategy { action.isEnableRunfiles()); Path tmpDir = tmpDirRoot.getChild( - getTmpDirName(action.getExecutionSettings().getExecutable().getExecPath())); + getTmpDirName( + action.getExecutionSettings().getExecutable().getExecPath(), + action.getShardNum(), + action.getRunNumber())); Map<String, String> env = setupEnvironment(action, execRoot, runfilesDir, tmpDir); Path workingDirectory = runfilesDir.getRelative(action.getRunfilesPrefix()); diff --git a/src/main/java/com/google/devtools/build/lib/exec/TestStrategy.java b/src/main/java/com/google/devtools/build/lib/exec/TestStrategy.java index 0a29b9f89d..7d98a9a942 100644 --- a/src/main/java/com/google/devtools/build/lib/exec/TestStrategy.java +++ b/src/main/java/com/google/devtools/build/lib/exec/TestStrategy.java @@ -32,6 +32,7 @@ import com.google.devtools.build.lib.rules.test.TestActionContext; import com.google.devtools.build.lib.rules.test.TestResult; import com.google.devtools.build.lib.rules.test.TestRunnerAction; import com.google.devtools.build.lib.rules.test.TestTargetExecutionSettings; +import com.google.devtools.build.lib.util.Fingerprint; import com.google.devtools.build.lib.util.OS; import com.google.devtools.build.lib.util.io.FileWatcher; import com.google.devtools.build.lib.util.io.OutErr; @@ -262,6 +263,14 @@ public abstract class TestStrategy implements TestActionContext { } } + protected String getTmpDirName(PathFragment execPath, int shard, int run) { + Fingerprint digest = new Fingerprint(); + digest.addPath(execPath); + digest.addInt(shard); + digest.addInt(run); + return digest.hexDigestAndReset(); + } + /** Parse a test result XML file into a {@link TestCase}. */ @Nullable protected TestCase parseTestResult(Path resultFile) { |