Skip to content

Commit 2e20943

Browse files
committed
fix TestAsyncSupplier
1 parent 71f9252 commit 2e20943

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

net.lecousin.core/src/test/java/net/lecousin/framework/core/tests/concurrent/async/TestAsyncSupplier.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,10 @@ public void run() {
315315
AsyncSupplier<Long, NoException> awl = awi.thenStart(converter, true);
316316
awi.unblockSuccess(Integer.valueOf(51));
317317
Assert.assertEquals(51L, awl.blockResult(5000).longValue());
318+
converter = new Task.Cpu.Parameter.FromFunction<Integer, Long>(
319+
"converter", Task.PRIORITY_NORMAL,
320+
i -> Long.valueOf(i.longValue())
321+
);
318322
awi = new AsyncSupplier<>();
319323
awl = awi.thenStart(converter, false);
320324
awi.unblockSuccess(Integer.valueOf(51));
@@ -325,7 +329,9 @@ public void run() {
325329
awi.thenDoOrStart(i -> okResult.set(i.intValue()), "test", Task.PRIORITY_NORMAL);
326330
Assert.assertEquals(0, okResult.get());
327331
awi.unblockSuccess(Integer.valueOf(51));
328-
while (okResult.get() != 51);
332+
while (okResult.get() != 51) {
333+
new Async<Exception>().block(100);
334+
}
329335

330336
awi = new AsyncSupplier<>();
331337
okResult.set(0);

0 commit comments

Comments
 (0)