From bfbd3c8c7ffa4b7faec2bae0bfd7c5bdf259f676 Mon Sep 17 00:00:00 2001 From: "Ilya.Kazakevich" Date: Wed, 1 Feb 2017 03:27:08 +0300 Subject: [PATCH] New test runners: do not set test duration to 0 explicitly * See commend in code --- .../sm/runner/GeneralIdBasedToSMTRunnerEventsConvertor.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/GeneralIdBasedToSMTRunnerEventsConvertor.java b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/GeneralIdBasedToSMTRunnerEventsConvertor.java index e18b6e875ca3..7d7b703935c9 100644 --- a/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/GeneralIdBasedToSMTRunnerEventsConvertor.java +++ b/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/GeneralIdBasedToSMTRunnerEventsConvertor.java @@ -178,7 +178,11 @@ public class GeneralIdBasedToSMTRunnerEventsConvertor extends GeneralTestEventsP Node node = findNodeToTerminate(testFinishedEvent); if (node != null) { SMTestProxy testProxy = node.getProxy(); - testProxy.setDuration(testFinishedEvent.getDuration()); + if (testFinishedEvent.getDuration() != 0) { + // Setting 0 here explicitly stops test from calculating its duration based on its children + // 0 is almost always means we did not get it any duration from test runner, so it is sane to calculate it based on parent + testProxy.setDuration(testFinishedEvent.getDuration()); + } testProxy.setFrameworkOutputFile(testFinishedEvent.getOutputFile()); testProxy.setFinished(); if (node.getState() != State.FAILED) {