Skip to content

Commit 28df426

Browse files
committed
Update AbstractDataBufferAllocatingTests
We are passing custom values to the constructor of PooledByteBufAllocator in tests in order to turn of caching. This is based on: netty/netty#5275 (comment) Netty 4.1.52 has significant changes in PooledByteBufAllocator: netty/netty#10267 After the changes, our current value for maxOrder=2, which results in chunkSize=16K, causes an assert failure in PoolChunk where the runSize exceeds the chunkSize.
1 parent 845cb71 commit 28df426

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

spring-core/src/testFixtures/java/org/springframework/core/testfixture/io/buffer/AbstractDataBufferAllocatingTests.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,12 @@ public static Stream<Arguments> dataBufferFactories() {
159159
new NettyDataBufferFactory(new UnpooledByteBufAllocator(true))),
160160
arguments("NettyDataBufferFactory - UnpooledByteBufAllocator - preferDirect = false",
161161
new NettyDataBufferFactory(new UnpooledByteBufAllocator(false))),
162-
// disable caching for reliable leak detection, see https://github.com/netty/netty/issues/5275
162+
// 1) Disable caching for reliable leak detection, see https://github.com/netty/netty/issues/5275
163+
// 2) maxOrder is 4 (vs default 11) but can be increased if necessary
163164
arguments("NettyDataBufferFactory - PooledByteBufAllocator - preferDirect = true",
164-
new NettyDataBufferFactory(new PooledByteBufAllocator(true, 1, 1, 4096, 2, 0, 0, 0, true))),
165+
new NettyDataBufferFactory(new PooledByteBufAllocator(true, 1, 1, 4096, 4, 0, 0, 0, true))),
165166
arguments("NettyDataBufferFactory - PooledByteBufAllocator - preferDirect = false",
166-
new NettyDataBufferFactory(new PooledByteBufAllocator(false, 1, 1, 4096, 2, 0, 0, 0, true))),
167+
new NettyDataBufferFactory(new PooledByteBufAllocator(false, 1, 1, 4096, 4, 0, 0, 0, true))),
167168
arguments("DefaultDataBufferFactory - preferDirect = true",
168169
new DefaultDataBufferFactory(true)),
169170
arguments("DefaultDataBufferFactory - preferDirect = false",

0 commit comments

Comments
 (0)