Skip to content

Fix ScopedObject cleanup for JUnit 5.9.x compatibility#157

Merged
tsegismont merged 1 commit intoeclipse-vertx:5.0from
tsegismont:backport-156
Mar 24, 2026
Merged

Fix ScopedObject cleanup for JUnit 5.9.x compatibility#157
tsegismont merged 1 commit intoeclipse-vertx:5.0from
tsegismont:backport-156

Conversation

@tsegismont
Copy link
Copy Markdown
Member

Backport #156

…#155) (eclipse-vertx#156)

See eclipse-vertx#155

ScopedObject must implement both ExtensionContext.Store.CloseableResource
and AutoCloseable to ensure proper cleanup across all JUnit 5.x versions.

JUnit 5.9.x and earlier only recognize CloseableResource for automatic
cleanup. Without it, ScopedObject.close() is never called, causing
resources (Vertx instances, HTTP servers) to leak between test iterations.

JUnit 5.11+ added AutoCloseable support, but we need both interfaces
for backward compatibility with users on older JUnit versions.

Signed-off-by: Thomas Segismont <[email protected]>
@tsegismont tsegismont merged commit 262f9e4 into eclipse-vertx:5.0 Mar 24, 2026
4 checks passed
@tsegismont tsegismont deleted the backport-156 branch March 24, 2026 16:55
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.

1 participant