Repository navigation
Auto-port 5.0: Avoid leak presence detector in leak profile - #17082
Merged
Merged
Conversation
Motivation: The `leak` Maven profile replaces the default JUnit extension autodetection argLine with paranoid Netty leak detection. Explicit tests that use `@ExtendWith(LeakPresenceExtension.class)` can still load `LeakPresenceExtension`, whose static initializer installs `WithTransferableScope` globally via `io.netty.customResourceLeakDetector`. In handler tests, classes run concurrently, so this can route unrelated tests through the leak presence detector without a per-test scope and trigger `Resource created outside test?` failures. Modification: Add a dedicated `io.netty.test.leakPresenceDetection.disabled` system property to the `leak` profile. When this property is set, `LeakPresenceExtension`: - skips installing the leak presence detector globally - disables tests that explicitly opt into the extension through the extension's own `ExecutionCondition` The existing strict missing-scope behavior in `WithTransferableScope.currentScope()` is unchanged. Result: The `leak` profile uses paranoid leak detection without enabling incompatible leak presence detection for explicit extension tests, avoiding cross-test contamination in parallel test runs. Verified with: - `./mvnw -pl testsuite-common -am -Dtest=LeakPresenceExtensionTest -Dsurefire.failIfNoSpecifiedTests=false test` - `./mvnw -Pleak -pl handler -am -Dtest=OpenSslCredentialBuilderTest,OpenSslEngineTest -Dsurefire.failIfNoSpecifiedTests=false test` Resolves #17067 Co-authored-by: multicode <[email protected]> (cherry picked from commit 9f403a8)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Auto-port of #17073 to 5.0
Cherry-picked commit: 9f403a8
Motivation:
The
leakMaven profile replaces the default JUnit extension autodetection argLine with paranoid Netty leak detection. Explicit tests that use@ExtendWith(LeakPresenceExtension.class)can still loadLeakPresenceExtension, whose static initializer installsWithTransferableScopeglobally viaio.netty.customResourceLeakDetector.In handler tests, classes run concurrently, so this can route unrelated tests through the leak presence detector without a per-test scope and trigger
Resource created outside test?failures.Modification:
Add a dedicated
io.netty.test.leakPresenceDetection.disabledsystem property to theleakprofile.When this property is set,
LeakPresenceExtension:ExecutionConditionThe existing strict missing-scope behavior in
WithTransferableScope.currentScope()is unchanged.Result:
The
leakprofile uses paranoid leak detection without enabling incompatible leak presence detection for explicit extension tests, avoiding cross-test contamination in parallel test runs.Verified with:
./mvnw -pl testsuite-common -am -Dtest=LeakPresenceExtensionTest -Dsurefire.failIfNoSpecifiedTests=false test./mvnw -Pleak -pl handler -am -Dtest=OpenSslCredentialBuilderTest,OpenSslEngineTest -Dsurefire.failIfNoSpecifiedTests=false testResolves #17067