In gRPC, client streaming and bidirectional streaming require to use a non-blocking (async) Stubs. These stubs uses different threads for handling sendMessage(T message) and onClose(status, trailers) events. Typically, it's not possible to create and commit a single Allure step within these methods, as AllureThreadContext internally uses ThreadLocal. However, it's possible to achieve this in a separate daemon thread.
Due to the asynchronous implementation of non-blocking stubs, we cannot guarantee that the Allure daemon thread committing the step will terminate immediately upon the completion of the non-blocking stub call. Therefore, for such non-blocking calls, it will be necessary to execute AllureGrpc.await() method after each test.
This approach is explained in the README and javadocs.
Context
In gRPC, client streaming and bidirectional streaming require to use a non-blocking (async) Stubs. These stubs uses different threads for handling
sendMessage(T message)
andonClose(status, trailers)
events. Typically, it's not possible to create and commit a single Allure step within these methods, asAllureThreadContext
internally usesThreadLocal
. However, it's possible to achieve this in a separate daemon thread.Due to the asynchronous implementation of non-blocking stubs, we cannot guarantee that the Allure daemon thread committing the step will terminate immediately upon the completion of the non-blocking stub call. Therefore, for such non-blocking calls, it will be necessary to execute
AllureGrpc.await()
method after each test.This approach is explained in the README and javadocs.
There is example report for bidirectional calls:
Checklist