GeezerVison is showing github.com — Fix test · netty/netty@eb39435
File tree
Expand file treeCollapse file tree
Open diff view settings
buffer/src/test/java/io/netty/buffer
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: buffer/src/test/java/io/netty/buffer/SizeClassedChunkCacheTest.java +3-7Lines changed: 3 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -352,20 +352,16 @@ void cacheSettlesAtRetentionFloorAfterBurstThreadLocal() { |
352 | 352 | void cacheSettlesAfterBurstShared() { |
353 | 353 | SizeClassedChunkCache cache = SizeClassedChunkCache.create(false); |
354 | 354 |
|
355 | | - int crq = AdaptivePoolingAllocator.CHUNK_REUSE_QUEUE; |
356 | | - int capacity = Math.max(16, crq * 2); |
357 | | - // Keep total offered within SHARED_CACHE_CAPACITY to avoid silent drops on bounded MPMC queue |
358 | | - int excess = Math.min(10, capacity - crq); |
359 | | - assertTrue(excess > 0, "excess must be positive for the test to be meaningful"); |
| 355 | + int excess = 10; |
360 | 356 | SizeClassedChunk workingSet = chunkWithCapacity(); |
361 | 357 | cache.offerChunk(workingSet); |
362 | | - for (int i = 0; i < crq - 1; i++) { |
| 358 | + for (int i = 0; i < AdaptivePoolingAllocator.CHUNK_REUSE_QUEUE - 1; i++) { |
363 | 359 | cache.offerChunk(chunkWithoutCapacity()); |
364 | 360 | } |
365 | 361 | SizeClassedChunk[] excessChunks = new SizeClassedChunk[excess]; |
366 | 362 | for (int i = 0; i < excess; i++) { |
367 | 363 | excessChunks[i] = fullChunk(); |
368 | | - assertTrue(cache.offerChunk(excessChunks[i]), "all excess chunks must be accepted by the queue"); |
| 364 | + cache.offerChunk(excessChunks[i]); |
369 | 365 | } |
370 | 366 |
|
371 | 367 | int maxCycles = (AdaptivePoolingAllocator.CHUNK_PURGE_THRESHOLD + 1) * 3; |
|