aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com
diff options
context:
space:
mode:
authorGravatar Ulf Adams <ulfjack@google.com>2017-01-13 11:08:04 +0000
committerGravatar Marcel Hlopko <hlopko@google.com>2017-01-13 13:53:54 +0000
commitbb1799333157345087249f82448db1982f92edb4 (patch)
treea629153de0191bfeb03731b74091e617ce9e6673 /src/main/java/com
parent55f69dc0baa0a4b8ee9a0276954885199aa4b742 (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. Effectively a rollback of the rollback, but with a manual fix. The problem was that the code was assuming exactly one process time, which is incorrect in at least the case where the proto comes from a previous Bazel version, because that didn't set the process time at all. We're now copying over all the values, which should work in all cases. -- PiperOrigin-RevId: 144425125 MOS_MIGRATED_REVID=144425125
Diffstat (limited to 'src/main/java/com')
-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 4ff761dbe1..9b2e1d3ab8 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
@@ -176,6 +176,7 @@ public class StandaloneTestStrategy extends TestStrategy {
// Add the test log to the output
dataBuilder.addFailedLogs(testLog.toString());
dataBuilder.addTestTimes(data.getTestTimes(0));
+ dataBuilder.addAllTestProcessTimes(data.getTestProcessTimesList());
processTestOutput(executor, outErr, new TestResult(action, data, false), testLog);
}
@@ -195,6 +196,7 @@ public class StandaloneTestStrategy extends TestStrategy {
dataBuilder.setPassedLog(data.getPassedLog());
}
dataBuilder.addTestTimes(data.getTestTimes(0));
+ dataBuilder.addAllTestProcessTimes(data.getTestProcessTimesList());
dataBuilder.setRunDurationMillis(data.getRunDurationMillis());
if (data.hasTestCase()) {
dataBuilder.setTestCase(data.getTestCase());
@@ -308,6 +310,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();