Skip to content

Commit 0265b79

Browse files
committed
improves test
Signed-off-by: Oleh Dokuka <[email protected]> Signed-off-by: Oleh Dokuka <[email protected]>
1 parent 8c55fe7 commit 0265b79

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

rsocket-core/src/test/java/io/rsocket/internal/UnboundedProcessorTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import io.netty.util.ReferenceCountUtil;
2626
import io.rsocket.buffer.LeaksTrackingByteBufAllocator;
2727
import io.rsocket.internal.subscriber.AssertSubscriber;
28+
import java.time.Duration;
2829
import org.junit.jupiter.api.BeforeAll;
2930
import org.junit.jupiter.api.RepeatedTest;
3031
import org.junit.jupiter.api.Timeout;
@@ -146,10 +147,10 @@ public void ensureUnboundedProcessorDisposesQueueProperly(boolean withFusionEnab
146147

147148
@RepeatedTest(
148149
name =
149-
"Ensures that racing between onNext | dispose | cancel | request(n) will not cause any issues and leaks in async backFused mode",
150+
"Ensures that racing between onNext + dispose | downstream async drain) should not cause any issues and leaks",
150151
value = 100000)
151152
@Timeout(10)
152-
public void ensureUnboundedProcessorDisposesQueueProperlyAsyncMode() {
153+
public void ensuresAsyncFusionAndDisposureHasNoDeadlock() {
153154
final LeaksTrackingByteBufAllocator allocator =
154155
LeaksTrackingByteBufAllocator.instrument(ByteBufAllocator.DEFAULT);
155156
final UnboundedProcessor<ByteBuf> unboundedProcessor = new UnboundedProcessor<>();
@@ -175,7 +176,7 @@ public void ensureUnboundedProcessorDisposesQueueProperlyAsyncMode() {
175176
unboundedProcessor::dispose,
176177
Schedulers.elastic());
177178

178-
assertSubscriber.values().forEach(ReferenceCountUtil::safeRelease);
179+
assertSubscriber.await(Duration.ofSeconds(5)).values().forEach(ReferenceCountUtil::safeRelease);
179180

180181
allocator.assertHasNoLeaks();
181182
}

0 commit comments

Comments
 (0)