Skip to content

Commit

Permalink
Add a test that properly verifies the handling of the duplicated cont…
Browse files Browse the repository at this point in the history
…ext when caching Uni

This is related to the commit f781b7f.
Tests added in f5af6b4 were not reproducing the issue.
I kept these tests because they do test a few other things (but not the original issue).
  • Loading branch information
cescoffier committed Jan 4, 2024
1 parent 6c5d8b7 commit c086d9a
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

import io.vertx.core.impl.VertxInternal;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.context.control.ActivateRequestContext;
import jakarta.inject.Inject;
Expand Down Expand Up @@ -156,7 +155,7 @@ void testDuplicatedContextHandlingWhenCalledContextAndAnsweredFromAnotherContext
@RepeatedTest(10)
void testWithAsyncTaskRestoringContext() throws InterruptedException {
var rootContext = vertx.getOrCreateContext();
var duplicatedContext1 = ((ContextInternal)rootContext).duplicate();
var duplicatedContext1 = ((ContextInternal) rootContext).duplicate();

CountDownLatch latch = new CountDownLatch(1);
duplicatedContext1.runOnContext(x -> {
Expand All @@ -168,7 +167,7 @@ void testWithAsyncTaskRestoringContext() throws InterruptedException {
});
});

var duplicatedContext2 = ((ContextInternal)rootContext).duplicate();
var duplicatedContext2 = ((ContextInternal) rootContext).duplicate();
CountDownLatch latch2 = new CountDownLatch(1);
duplicatedContext2.runOnContext(x -> {
cachedService.async()
Expand Down

0 comments on commit c086d9a

Please sign in to comment.