codec-http2: Stop leaking in header downgrader test
Motivation: We're leaking requests in our Http2ServerDowngrader tests when we allocate a buffer using the local allocator. Modification: Release the request later when the request is constructed with the local allocator. Result: Less leaky tests.
This commit is contained in:
parent
24784bfcd1
commit
4d2e91a10d
@ -34,6 +34,7 @@ import io.netty.handler.codec.http.HttpResponseStatus;
|
||||
import io.netty.handler.codec.http.HttpVersion;
|
||||
import io.netty.handler.codec.http.LastHttpContent;
|
||||
import io.netty.util.CharsetUtil;
|
||||
import io.netty.util.ReferenceCountUtil;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
@ -246,6 +247,7 @@ public class Http2ServerDowngraderTest {
|
||||
assertTrue(ch.writeInbound(new DefaultHttp2HeadersFrame(headers, true)));
|
||||
|
||||
FullHttpRequest request = ch.readInbound();
|
||||
ReferenceCountUtil.releaseLater(request);
|
||||
assertThat(request.uri(), is("/"));
|
||||
assertThat(request.method(), is(HttpMethod.GET));
|
||||
assertThat(request.protocolVersion(), is(HttpVersion.HTTP_1_1));
|
||||
|
Loading…
Reference in New Issue
Block a user