Is this expected behaviour for SMTRunnerEventsListener? Follow
Answered
I have my own
SMTRunnerEventsListener
and I am overriding the onTestFinished() method. What I observed is that if I block the onTestFinished() method (I do not return for a while), then the next unit test is not started. This is expected behavior and I need this functionality for my plugin. But I have observed that this does not work for the second test for some reason(when I run a test class which contains many methods annotated with @Test). I am using JUnit 5.
So if I have
@Override
public void onTestFinished(@NotNull SMTestProxy smTestProxy) {
try {
Thread.sleep(9000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
The second test is started even before the sleep is over(third unit test is not started). Is this a bug or expected behavior?
Please sign in to leave a comment.
Hi,
It's unexpected though if your first test fails then `testFinished` may be omitted and this means that listener won't be called at all.
Could you please check this scenario? BTW if you enable logging for
then you may get more info on the events, etc
Anna
Hey Anna,
Thanks for the quick reply. I have 3 tests and none of them fails. The
is called three times but not timed correctly(as previously said).
I will debug IntelliJ's code to see where the issue is.