Fix OTel JUnit5 Extension cleanup when using Nested test classes by ps-mir · Pull Request #7999 · open-telemetry/opentelemetry-java

added 4 commits

January 21, 2026 16:45
Reproduces issue open-telemetry#7919 where extension's `afterAll` hook is called
prematurely after one nested test class execution completes, making the
extension unusable for other nested test class.
The afterAll lifecycle callback requires a valid ExtensionContext to
determine if cleanup should occur at the top level. The test was
previously passing null, causing NPE after the nested class handling
logic was added.
The nested class path (where close() is not called) was not covered,
causing codecov patch coverage to fall below the 80% threshold.

Added a test for NestedClass scenario to validate that sdk remains
functional when afterAll is called post Nested class test.

@ps-mir ps-mir marked this pull request as ready for review

January 21, 2026 17:21

jkwatson