Skip to content

Commit

Permalink
enable leak detector in reactor-netty-core
Browse files Browse the repository at this point in the history
  • Loading branch information
sullis committed Mar 20, 2024
1 parent 229de17 commit 016f1b9
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions reactor-netty-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ dependencies {
testImplementation "org.awaitility:awaitility:$awaitilityVersion"
testImplementation "org.junit.jupiter:junit-jupiter-api:$junitVersion"
testImplementation "org.junit.jupiter:junit-jupiter-params:$junitVersion"
testImplementation "io.github.nettyplus:netty-leak-detector-junit-extension:$nettyLeakDetectorJunitExtensionVersion"
testImplementation "org.mockito:mockito-core:$mockitoVersion"
testImplementation "ch.qos.logback:logback-classic:$logbackVersion"
testImplementation "io.projectreactor.tools:blockhound-junit-platform:$blockHoundVersion"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
*/
package reactor.netty;

import io.github.nettyplus.leakdetector.junit.NettyLeakDetectorExtension;
import io.netty.buffer.ByteBuf;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.reactivestreams.Publisher;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
Expand All @@ -38,6 +40,7 @@

import static org.assertj.core.api.Assertions.assertThat;

@ExtendWith(NettyLeakDetectorExtension.class)
class ByteBufFluxTest {

private static File temporaryDirectory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
*/
package reactor.netty;

import io.github.nettyplus.leakdetector.junit.NettyLeakDetectorExtension;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.reactivestreams.Publisher;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
Expand All @@ -24,6 +26,7 @@
import java.nio.charset.Charset;
import java.time.Duration;

@ExtendWith(NettyLeakDetectorExtension.class)
class ByteBufMonoTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.BiConsumer;

import io.github.nettyplus.leakdetector.junit.NettyLeakDetectorExtension;
import io.netty.channel.Channel;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerAdapter;
Expand All @@ -30,6 +31,7 @@
import io.netty.handler.codec.http.websocketx.Utf8FrameValidator;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import reactor.core.Disposable;
import reactor.core.publisher.Mono;

Expand All @@ -42,6 +44,7 @@
* @author Simon Baslé
* @author Violeta Georgieva
*/
@ExtendWith(NettyLeakDetectorExtension.class)
class ConnectionTest {

static final BiConsumer<? super ChannelHandlerContext, Object> ADD_EXTRACTOR = ChannelHandlerContext::fireChannelRead;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import java.util.function.Predicate;
import javax.net.ssl.SSLException;

import io.github.nettyplus.leakdetector.junit.NettyLeakDetectorExtension;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufAllocator;
import io.netty.channel.ChannelFuture;
Expand All @@ -52,11 +53,13 @@
import io.netty.util.ReferenceCountUtil;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.reactivestreams.Publisher;
import reactor.core.publisher.Mono;

import static org.assertj.core.api.Assertions.assertThat;

@ExtendWith(NettyLeakDetectorExtension.class)
class NettyOutboundTest {

static SelfSignedCertificate ssc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package reactor.netty;

import io.github.nettyplus.leakdetector.junit.NettyLeakDetectorExtension;
import io.netty.channel.AbstractChannel;
import io.netty.channel.Channel;
import io.netty.channel.ChannelConfig;
Expand All @@ -23,6 +24,7 @@
import io.netty.channel.EventLoop;
import io.netty.channel.embedded.EmbeddedChannel;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import reactor.util.annotation.Nullable;

import java.net.InetSocketAddress;
Expand All @@ -35,6 +37,7 @@
*
* @author Violeta Georgieva
*/
@ExtendWith(NettyLeakDetectorExtension.class)
class ReactorNettyTest {

/*
Expand Down

0 comments on commit 016f1b9

Please sign in to comment.