Skip to content

Support CompletionStage friendly method signature #5292

@rmannibucau

Description

@rmannibucau

It is common to have promise friendly code - and virtual threads will not change that so much, at least for libs.

And all the time in code we do promise.get() to be able to comply to junit signature support.

Request is to enable to return a promise (@Test CompletionStage<?> myTest() { ... }).

This will enable to define the test code as most of the code base with promise related API and not have to block randomly sometimes leveraging better the CPU in concurrent mode.

Then junit runtome will try/catch around the test method as today but if result is a promise it will await it using whenComplete it to check if there is a failure or not.

The framework will guarantee all promises are done before exiting - as today implicitly.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions