Skip to content

Commit

Permalink
Additional test for reactor#1817
Browse files Browse the repository at this point in the history
Add test for flush on each disabled.
  • Loading branch information
violetagg committed Sep 23, 2021
1 parent d66c3a1 commit 93d927d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions reactor-netty-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ dependencies {
testCompile "org.assertj:assertj-core:$assertJVersion"
testCompile "org.awaitility:awaitility:$awaitilityVersion"
testCompile "org.junit.jupiter:junit-jupiter-api:$junitVersion"
testCompile "org.junit.jupiter:junit-jupiter-params:$junitVersion"
testCompile "org.mockito:mockito-core:$mockitoVersion"
testCompile "ch.qos.logback:logback-classic:$logbackVersion"
testCompile "io.projectreactor.tools:blockhound-junit-platform:$blockHoundVersion"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

import io.netty.buffer.Unpooled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
import reactor.core.publisher.Flux;
import reactor.netty.tcp.TcpServer;

Expand All @@ -32,8 +34,9 @@

class TcpEmissionTest {

@Test
void testBackpressure() throws Exception {
@ParameterizedTest
@ValueSource(booleans = {true, false})
void testBackpressure(boolean flushOnEach) throws Exception {
byte[] array = new byte[32];
Random random = new Random();
final int emissionCount = 130;
Expand All @@ -47,7 +50,7 @@ void testBackpressure() throws Exception {
random.nextBytes(array);
return Unpooled.copiedBuffer(array);
})),
b -> true))
b -> flushOnEach))
.host("localhost")
.port(0)
.bindNow();
Expand Down

0 comments on commit 93d927d

Please sign in to comment.