You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noted in the source code that a CountDownLatch already exists in the VertxTestContext class, but somehow it is not being reached/used.
So, doing some debugging I've noted that the io.vertx.junit5.VertxTestContext.awaitCompletion, that calls the latch, is being called inside the joinActiveTestContexts method, which is called in all the test lifecycle methods (beforeAll, beforeEach, and others).
But it will reach the latch ONLY IF a VertxTestContext instance was already created.
private void joinActiveTestContexts(ExtensionContext extensionContext) throws Exception {
ContextList currentContexts = store(extensionContext).remove(TEST_CONTEXT_KEY, ContextList.class);
if (currentContexts != null) { <---- **condition1**
for (VertxTestContext context : currentContexts) {
...
if (context.awaitCompletion(timeoutDuration, timeoutUnit)) {
And, in the debug I'm doing, that is never true, just because the VertxTestContext instance that is stored in currentContexts checked above is being created only in the method io.vertx.junit5.VertxExtension.resolveParameter, which is always called after all other lifecycle methods, so the condition1 is aways false.
The text was updated successfully, but these errors were encountered:
Version
4.0.0-SNAPSHOT
Context
My junit5 based tests are finishing before the execution of future calls unless I use a
CountDownLatch
on my own.I noted in the source code that a
CountDownLatch
already exists in theVertxTestContext
class, but somehow it is not being reached/used.So, doing some debugging I've noted that the
io.vertx.junit5.VertxTestContext.awaitCompletion
, that calls the latch, is being called inside thejoinActiveTestContexts
method, which is called in all the test lifecycle methods (beforeAll, beforeEach, and others).But it will reach the latch ONLY IF a VertxTestContext instance was already created.
And, in the debug I'm doing, that is never true, just because the VertxTestContext instance that is stored in
currentContexts
checked above is being created only in the methodio.vertx.junit5.VertxExtension.resolveParameter
, which is always called after all other lifecycle methods, so the condition1 is aways false.The text was updated successfully, but these errors were encountered: