Skip to content

Fix testLatestDeps#18324

Merged
trask merged 1 commit into
open-telemetry:mainfrom
trask:fix-test-latest-deps
Apr 27, 2026
Merged

Fix testLatestDeps#18324
trask merged 1 commit into
open-telemetry:mainfrom
trask:fix-test-latest-deps

Conversation

@trask

@trask trask commented Apr 26, 2026

Copy link
Copy Markdown
Member

Auto-merged something bad just before the pinning PR got in 🤦‍♂️

AfterAllCallback.afterAll() fires once per container the extension is registered in, including each @nested class (since static @RegisterExtension fields are inherited). This caused deferAfterAll cleanups to run as soon as the first nested container completed.

Track the outermost container via beforeAll and only run deferAfterAll cleanups when afterAll fires on that same context.

This was breaking ApacheHttpAsyncClientTest, where the shared async clients were closed after the first nested test class finished, causing all subsequent nested tests to fail with CancellationException.

AfterAllCallback.afterAll() fires once per container the extension is
registered in, including each @nested class (since static @RegisterExtension
fields are inherited). This caused deferAfterAll cleanups to run as soon
as the first nested container completed.

Track the outermost container via beforeAll and only run deferAfterAll
cleanups when afterAll fires on that same context.

This was breaking ApacheHttpAsyncClientTest, where the shared async
clients were closed after the first nested test class finished, causing
all subsequent nested tests to fail with CancellationException.
@trask trask requested a review from a team as a code owner April 26, 2026 22:44
@trask trask merged commit 09f3efe into open-telemetry:main Apr 27, 2026
177 of 179 checks passed
@trask trask deleted the fix-test-latest-deps branch April 27, 2026 00:49
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.

2 participants