mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java-tests] IDEA-169282 IJ-CR-152163 Unit test elapsed time should be a wall time from start to end for Gradle, TestNG, JUnit
- fix IDEA-365756, terminated case GitOrigin-RevId: 6c2064a5785b97a85e41ab5a9e5b8dbc3dbce80e
This commit is contained in:
committed by
intellij-monorepo-bot
parent
b99ef38216
commit
2afb61710c
+2
-1
@@ -132,7 +132,8 @@ public class JavaSMTRunnerTestTreeView extends SMTRunnerTestTreeView implements
|
||||
SMTestProxy test = getSelectedTest(location);
|
||||
|
||||
if (test == null || test.isLeaf() || test.getDurationStrategy() != TestDurationStrategy.AUTOMATIC ||
|
||||
test.getEndTime() == null || test.getStartTime() == null) {
|
||||
test.getEndTime() == null || test.getStartTime() == null ||
|
||||
test.getEndTime() <= test.getStartTime()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -883,7 +883,7 @@ public class SMTestProxy extends AbstractTestProxy implements Navigatable {
|
||||
if (myState.isFinal()) {
|
||||
return;
|
||||
}
|
||||
if (myEndTime != null) {
|
||||
if (myEndTime == null) {
|
||||
myEndTime = endTime;
|
||||
}
|
||||
myState = TerminatedState.INSTANCE;
|
||||
|
||||
+16
@@ -1154,6 +1154,22 @@ public class SMTestProxyTest extends BaseSMTRunnerTestCase {
|
||||
assertTrue(root.getEndTime() - root.getStartTime() != root.getDuration());
|
||||
}
|
||||
|
||||
public void testDisplayOwnTimeTerminated() {
|
||||
SMTestProxy root = createSuiteProxy("root");
|
||||
SMTestProxy child1 = createTestProxy("child1", root);
|
||||
SMTestProxy child2 = createTestProxy("child12", root);
|
||||
|
||||
root.setStarted();
|
||||
|
||||
child1.setStarted();
|
||||
|
||||
root.setTerminated();
|
||||
|
||||
assertNotNull(root.getEndTime());
|
||||
assertNotNull(child1.getEndTime());
|
||||
assertNotNull(child2.getEndTime());
|
||||
}
|
||||
|
||||
private static void assertDisplayTimeEqualsToSumOfChildren(@NotNull SMTestProxy node) {
|
||||
List<? extends SMTestProxy> children = node.collectChildren(new Filter<>() {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user