FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Auto-port 5.0: Avoid leak presence detector in leak profile by netty-project-bot · Pull Request #17082 · netty/netty · GitHub

/ netty Public

Auto-port 5.0: Avoid leak presence detector in leak profile - #17082

Merged
normanmaurer merged 1 commit into
5.0from
auto-port-pr-17073-to-5.0
Jul 10, 2026
Merged

normanmaurer merged 1 commit into
5.0from
auto-port-pr-17073-to-5.0

Conversation

Copy link
Copy Markdown
Contributor

Auto-port of #17073 to 5.0
Cherry-picked commit: 9f403a8


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

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 <multicode@yawk.at>
(cherry picked from commit 9f403a8)
normanmaurer added this to the 5.0.0.Final milestone Jul 10, 2026
normanmaurer merged commit b79eaad into 5.0 Jul 10, 2026
12 of 13 checks passed
normanmaurer deleted the auto-port-pr-17073-to-5.0 branch July 10, 2026 04:06
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL