mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-19 04:45:07 -04:00
Release buffers in netty test (#126744)
This commit is contained in:
parent
b47bd3adc7
commit
f9f3defe92
1 changed files with 4 additions and 3 deletions
|
@ -111,7 +111,9 @@ public class Netty4HttpHeaderValidatorTests extends ESTestCase {
|
|||
channel.writeInbound(last);
|
||||
if (shouldPassValidation) {
|
||||
assertEquals("should pass content for valid request", content, channel.readInbound());
|
||||
content.release();
|
||||
assertEquals(last, channel.readInbound());
|
||||
last.release();
|
||||
} else {
|
||||
assertNull("should drop content for invalid request", channel.readInbound());
|
||||
}
|
||||
|
@ -138,7 +140,7 @@ public class Netty4HttpHeaderValidatorTests extends ESTestCase {
|
|||
assertNull("content should not pass yet, need explicit read", channel.readInbound());
|
||||
|
||||
channel.read();
|
||||
assertTrue(channel.readInbound() instanceof LastHttpContent);
|
||||
asInstanceOf(LastHttpContent.class, channel.readInbound()).release();
|
||||
}
|
||||
|
||||
public void testWithFlowControlAndAggregator() {
|
||||
|
@ -157,9 +159,8 @@ public class Netty4HttpHeaderValidatorTests extends ESTestCase {
|
|||
validationRequest.listener.onResponse(null);
|
||||
channel.runPendingTasks();
|
||||
|
||||
assertTrue(channel.readInbound() instanceof FullHttpRequest);
|
||||
asInstanceOf(FullHttpRequest.class, channel.readInbound()).release();
|
||||
}
|
||||
|
||||
record ValidationRequest(HttpRequest request, Channel channel, ActionListener<Void> listener) {}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue