From 28df4267984e42fcfd59f9116330d57e114e5db8 Mon Sep 17 00:00:00 2001 From: Rossen Stoyanchev Date: Tue, 15 Sep 2020 11:29:13 +0100 Subject: [PATCH] Update AbstractDataBufferAllocatingTests We are passing custom values to the constructor of PooledByteBufAllocator in tests in order to turn of caching. This is based on: https://github.com/netty/netty/issues/5275#issuecomment-220547057 Netty 4.1.52 has significant changes in PooledByteBufAllocator: https://github.com/netty/netty/pull/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. --- .../io/buffer/AbstractDataBufferAllocatingTests.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spring-core/src/testFixtures/java/org/springframework/core/testfixture/io/buffer/AbstractDataBufferAllocatingTests.java b/spring-core/src/testFixtures/java/org/springframework/core/testfixture/io/buffer/AbstractDataBufferAllocatingTests.java index 41e11653b0..aaa48bff51 100644 --- a/spring-core/src/testFixtures/java/org/springframework/core/testfixture/io/buffer/AbstractDataBufferAllocatingTests.java +++ b/spring-core/src/testFixtures/java/org/springframework/core/testfixture/io/buffer/AbstractDataBufferAllocatingTests.java @@ -159,11 +159,12 @@ public abstract class AbstractDataBufferAllocatingTests { new NettyDataBufferFactory(new UnpooledByteBufAllocator(true))), arguments("NettyDataBufferFactory - UnpooledByteBufAllocator - preferDirect = false", new NettyDataBufferFactory(new UnpooledByteBufAllocator(false))), - // disable caching for reliable leak detection, see https://github.com/netty/netty/issues/5275 + // 1) Disable caching for reliable leak detection, see https://github.com/netty/netty/issues/5275 + // 2) maxOrder is 4 (vs default 11) but can be increased if necessary arguments("NettyDataBufferFactory - PooledByteBufAllocator - preferDirect = true", - new NettyDataBufferFactory(new PooledByteBufAllocator(true, 1, 1, 4096, 2, 0, 0, 0, true))), + new NettyDataBufferFactory(new PooledByteBufAllocator(true, 1, 1, 4096, 4, 0, 0, 0, true))), arguments("NettyDataBufferFactory - PooledByteBufAllocator - preferDirect = false", - new NettyDataBufferFactory(new PooledByteBufAllocator(false, 1, 1, 4096, 2, 0, 0, 0, true))), + new NettyDataBufferFactory(new PooledByteBufAllocator(false, 1, 1, 4096, 4, 0, 0, 0, true))), arguments("DefaultDataBufferFactory - preferDirect = true", new DefaultDataBufferFactory(true)), arguments("DefaultDataBufferFactory - preferDirect = false",