#8188: fix test flakiness by handling null buffers returned by the pool

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
This commit is contained in:
Ludovic Orban 2022-06-21 19:59:28 +02:00
parent 110896b4d1
commit 7b57307c71
1 changed files with 6 additions and 3 deletions

View File

@ -826,7 +826,8 @@ public class HttpClientTLSTest
public ByteBuffer acquire(int size, boolean direct)
{
ByteBuffer acquired = super.acquire(size, direct);
leakedBuffers.add(acquired);
if (acquired != null)
leakedBuffers.add(acquired);
return acquired;
}
@ -895,7 +896,8 @@ public class HttpClientTLSTest
public ByteBuffer acquire(int size, boolean direct)
{
ByteBuffer acquired = super.acquire(size, direct);
leakedBuffers.add(acquired);
if (acquired != null)
leakedBuffers.add(acquired);
return acquired;
}
@ -978,7 +980,8 @@ public class HttpClientTLSTest
public ByteBuffer acquire(int size, boolean direct)
{
ByteBuffer acquired = super.acquire(size, direct);
leakedBuffers.add(acquired);
if (acquired != null)
leakedBuffers.add(acquired);
return acquired;
}