Skip to content

Commit efb3aa3

Browse files
committed
Revert "Release buffers in netty test (elastic#126744)"
This reverts commit f9f3def.
1 parent d19b525 commit efb3aa3

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

modules/transport-netty4/src/test/java/org/elasticsearch/http/netty4/Netty4HttpHeaderValidatorTests.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,7 @@ public void testMixedValidationResults() {
111111
channel.writeInbound(last);
112112
if (shouldPassValidation) {
113113
assertEquals("should pass content for valid request", content, channel.readInbound());
114-
content.release();
115114
assertEquals(last, channel.readInbound());
116-
last.release();
117115
} else {
118116
assertNull("should drop content for invalid request", channel.readInbound());
119117
}
@@ -140,7 +138,7 @@ public void testIgnoreReadWhenValidating() {
140138
assertNull("content should not pass yet, need explicit read", channel.readInbound());
141139

142140
channel.read();
143-
asInstanceOf(LastHttpContent.class, channel.readInbound()).release();
141+
assertTrue(channel.readInbound() instanceof LastHttpContent);
144142
}
145143

146144
public void testWithFlowControlAndAggregator() {
@@ -159,8 +157,9 @@ public void testWithFlowControlAndAggregator() {
159157
validationRequest.listener.onResponse(null);
160158
channel.runPendingTasks();
161159

162-
asInstanceOf(FullHttpRequest.class, channel.readInbound()).release();
160+
assertTrue(channel.readInbound() instanceof FullHttpRequest);
163161
}
164162

165163
record ValidationRequest(HttpRequest request, Channel channel, ActionListener<Void> listener) {}
164+
166165
}

0 commit comments

Comments
 (0)