Skip to content

Commit

Permalink
improves test
Browse files Browse the repository at this point in the history
Signed-off-by: Oleh Dokuka <odokuka@vmware.com>
Signed-off-by: Oleh Dokuka <shadowgun@i.ua>
  • Loading branch information
OlegDokuka committed Feb 26, 2021
1 parent 8c55fe7 commit 0265b79
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import io.netty.util.ReferenceCountUtil;
import io.rsocket.buffer.LeaksTrackingByteBufAllocator;
import io.rsocket.internal.subscriber.AssertSubscriber;
import java.time.Duration;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.RepeatedTest;
import org.junit.jupiter.api.Timeout;
Expand Down Expand Up @@ -146,10 +147,10 @@ public void ensureUnboundedProcessorDisposesQueueProperly(boolean withFusionEnab

@RepeatedTest(
name =
"Ensures that racing between onNext | dispose | cancel | request(n) will not cause any issues and leaks in async backFused mode",
"Ensures that racing between onNext + dispose | downstream async drain) should not cause any issues and leaks",
value = 100000)
@Timeout(10)
public void ensureUnboundedProcessorDisposesQueueProperlyAsyncMode() {
public void ensuresAsyncFusionAndDisposureHasNoDeadlock() {
final LeaksTrackingByteBufAllocator allocator =
LeaksTrackingByteBufAllocator.instrument(ByteBufAllocator.DEFAULT);
final UnboundedProcessor<ByteBuf> unboundedProcessor = new UnboundedProcessor<>();
Expand All @@ -175,7 +176,7 @@ public void ensureUnboundedProcessorDisposesQueueProperlyAsyncMode() {
unboundedProcessor::dispose,
Schedulers.elastic());

assertSubscriber.values().forEach(ReferenceCountUtil::safeRelease);
assertSubscriber.await(Duration.ofSeconds(5)).values().forEach(ReferenceCountUtil::safeRelease);

allocator.assertHasNoLeaks();
}
Expand Down

0 comments on commit 0265b79

Please sign in to comment.