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-01-10 15:40:55 +0000
committerGravatar Marcel Hlopko <hlopko@google.com>2017-01-10 15:53:39 +0000
commit62a6f695f95b8dde15fe9b287a290dc7ac06e173 (patch)
treee2059a3ef4faef6327f912d18a02c6827a8cc009 /src/main/java/com/google/devtools/build/lib/exec/StandaloneTestStrategy.java
parent9f915545df4ca6dae044b9e02186b3616ddf5418 (diff)
Also add the duration as the test process time.
Technically, this code is incorrect, because we're calling into spawn strategy, which might do any amount of additional waiting (e.g., to acquire local resources). We should change spawn strategy to return structured information about the subprocess execution, including the wall time, and use that to set the test information. But for now, this seems good enough. Fixes #1748. -- PiperOrigin-RevId: 144082073 MOS_MIGRATED_REVID=144082073
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.java3
1 files changed, 3 insertions, 0 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 815e65e8a1..3543737773 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
@@ -159,6 +159,7 @@ public class StandaloneTestStrategy extends TestStrategy {
// Add the test log to the output
dataBuilder.addFailedLogs(testLog.toString());
dataBuilder.addTestTimes(data.getTestTimes(0));
+ dataBuilder.addTestProcessTimes(data.getTestProcessTimes(0));
processTestOutput(executor, outErr, new TestResult(action, data, false), testLog);
}
@@ -178,6 +179,7 @@ public class StandaloneTestStrategy extends TestStrategy {
dataBuilder.setPassedLog(data.getPassedLog());
}
dataBuilder.addTestTimes(data.getTestTimes(0));
+ dataBuilder.addTestProcessTimes(data.getTestProcessTimes(0));
dataBuilder.setRunDurationMillis(data.getRunDurationMillis());
if (data.hasTestCase()) {
dataBuilder.setTestCase(data.getTestCase());
@@ -313,6 +315,7 @@ public class StandaloneTestStrategy extends TestStrategy {
} finally {
long duration = executor.getClock().currentTimeMillis() - startTime;
builder.addTestTimes(duration);
+ builder.addTestProcessTimes(duration);
builder.setRunDurationMillis(duration);
if (streamed != null) {
streamed.close();