Skip to content

Conversation

@yawkat
Copy link
Member

@yawkat yawkat commented Oct 17, 2025

Netty 4.2.7 introduced a new leak detection mechanism for tests that is more reliable and has lower overhead. micronaut-projects/micronaut-test#1291 introduces a micronaut-test module that uses this new mechanism. However, the new detector is more strict about resource lifetimes, so tests need various small adjustments:

  • Contexts must be closed at the end of the test
  • Event loops must be shut down
  • Tests must use only threads created in those tests (no Finalizers, no reactive boundedElastic)
  • SSL contexts must be released immediately

There is also one minor leak fix in this PR, related to h2c support, in Http2ServerHandler.

Draft because this requires the new micronaut-test module.

Netty 4.2.7 introduced a new leak detection mechanism for tests that is more reliable and has lower overhead. micronaut-projects/micronaut-test#1291 introduces a micronaut-test module that uses this new mechanism. However, the new detector is more strict about resource lifetimes, so tests need various small adjustments:

- Contexts must be closed at the end of the test
- Event loops must be shut down
- Tests must use only threads created in those tests (no Finalizers, no reactive boundedElastic)
- SSL contexts must be released immediately

There is also one minor leak fix in this PR, related to h2c support, in Http2ServerHandler.

Draft because this requires the new micronaut-test module.
@yawkat yawkat added the type: improvement A minor improvement to an existing feature label Oct 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: improvement A minor improvement to an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant