mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java-tests] IDEA-365965 Stopping testNG tests running in parallel doesn't stop the timer and animation on all the running tests
GitOrigin-RevId: 8fd17e4f3729aa8eb3135bc33e27728d41d94add
This commit is contained in:
committed by
intellij-monorepo-bot
parent
389425eb1a
commit
c6bf99c010
+15
-10
@@ -880,24 +880,29 @@ public class SMTestProxy extends AbstractTestProxy implements Navigatable {
|
||||
* @see SMTestProxy#setTerminated
|
||||
*/
|
||||
private void setTerminated(long endTime) {
|
||||
if (myState.isFinal()) {
|
||||
return;
|
||||
}
|
||||
//some framework can mark suite as passed even if they contain running items,
|
||||
//so let's check everything but update only running items
|
||||
boolean beforeIsFinal = myState.isFinal();
|
||||
if (myEndTime == null) {
|
||||
myEndTime = endTime;
|
||||
}
|
||||
myState = TerminatedState.INSTANCE;
|
||||
Long startTime = myStartTime;
|
||||
if (!myIsSuite && startTime != null) {
|
||||
setDuration(endTime - startTime);
|
||||
} else if (!myIsSuite) {
|
||||
setDuration(0);
|
||||
if (!beforeIsFinal) {
|
||||
myState = TerminatedState.INSTANCE;
|
||||
Long startTime = myStartTime;
|
||||
if (!myIsSuite && startTime != null) {
|
||||
setDuration(endTime - startTime);
|
||||
}
|
||||
else if (!myIsSuite) {
|
||||
setDuration(0);
|
||||
}
|
||||
}
|
||||
final List<? extends SMTestProxy> children = getChildren();
|
||||
for (SMTestProxy child : children) {
|
||||
child.setTerminated(endTime);
|
||||
}
|
||||
fireOnNewPrintable(myState);
|
||||
if (!beforeIsFinal) {
|
||||
fireOnNewPrintable(myState);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+33
@@ -1170,6 +1170,39 @@ public class SMTestProxyTest extends BaseSMTRunnerTestCase {
|
||||
assertNotNull(child2.getEndTimeMillis());
|
||||
}
|
||||
|
||||
public void testTerminatedWithNonFinished() {
|
||||
SMTestProxy root = createSuiteProxy("root");
|
||||
SMTestProxy suite1 = createSuiteProxy("suite1", root);
|
||||
SMTestProxy suite2 = createSuiteProxy("suite2", root);
|
||||
|
||||
root.setStarted();
|
||||
|
||||
suite1.setStarted();
|
||||
suite1.setFinished();
|
||||
|
||||
SMTestProxy test1 = createTestProxy("test1", suite1);
|
||||
SMTestProxy test2 = createTestProxy("test2", suite2);
|
||||
|
||||
test1.setStarted();
|
||||
suite2.setStarted();
|
||||
test2.setStarted();
|
||||
|
||||
root.setTerminated();
|
||||
|
||||
assertNotNull(root.getEndTimeMillis());
|
||||
assertNotNull(suite1.getEndTimeMillis());
|
||||
assertNotNull(suite2.getEndTimeMillis());
|
||||
assertNotNull(test1.getEndTimeMillis());
|
||||
assertNotNull(test2.getEndTimeMillis());
|
||||
|
||||
assertTrue(root.wasTerminated());
|
||||
assertTrue(suite1.isPassed());
|
||||
assertTrue(suite2.wasTerminated());
|
||||
assertTrue(test1.wasTerminated());
|
||||
assertTrue(test2.wasTerminated());
|
||||
}
|
||||
|
||||
|
||||
private static void assertDisplayTimeEqualsToSumOfChildren(@NotNull SMTestProxy node) {
|
||||
List<? extends SMTestProxy> children = node.collectChildren(new Filter<>() {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user