-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve discovery of (and fix some) netty-releated test buffer leaks #3176
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -233,6 +233,11 @@ final class ServiceTalkLibraryPlugin extends ServiceTalkCorePlugin { | |
// Always require native libraries for running tests. This helps to make sure transport-level state machine | ||
// receives all expected network events from Netty. | ||
systemProperty "io.servicetalk.transport.netty.requireNativeLibs", "true" | ||
|
||
// Make sure we enable netty leak detection for our tests. By default these are not visible in the logs, | ||
// to see them you must at --warn to your ./gradlew test run in order to see the "showStandardStreams". | ||
systemProperty "io.netty.leakDetection.level", "PARANOID" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One of the main goals is to check for leaks automatically via We should find a way to always be One potential idea is to change |
||
systemProperty "io.netty.leakDetection.targetRecords", "25" | ||
} | ||
|
||
dependencies { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,7 +62,6 @@ | |
import static org.hamcrest.Matchers.is; | ||
|
||
class ServerRespondsOnClosingTest { | ||
|
||
private static final HttpResponseFactory RESPONSE_FACTORY = new DefaultHttpResponseFactory( | ||
DefaultHttpHeadersFactory.INSTANCE, DEFAULT_ALLOCATOR, HTTP_1_1); | ||
private static final String RESPONSE_PAYLOAD_BODY = "Hello World"; | ||
|
@@ -252,6 +251,8 @@ private void verifyResponse(String requestPath) { | |
assertThat("Unexpected response meta-data", metaData.toString(US_ASCII), containsString(requestPath)); | ||
ByteBuf payloadBody = channel.readOutbound(); | ||
assertThat("Unexpected response payload body", payloadBody.toString(US_ASCII), equalTo(RESPONSE_PAYLOAD_BODY)); | ||
metaData.release(); | ||
payloadBody.release(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think these should be in a |
||
} | ||
|
||
private void respondWithFIN() throws Exception { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at -> add?