-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Support CompletionStage friendly method signature #5292
Copy link
Copy link
Open
Description
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.
Reactions are currently unavailable