Skip to content

Conversation

dtuchs
Copy link

@dtuchs dtuchs commented Mar 2, 2024

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) 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.

There is example report for bidirectional calls:
Screenshot 2024-03-02 at 22 32 33

Checklist

@dtuchs dtuchs mentioned this pull request Mar 2, 2024
2 tasks
@dtuchs
Copy link
Author

dtuchs commented Mar 2, 2024

Also bug #973 should be fixed.

@dtuchs dtuchs marked this pull request as draft March 4, 2024 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant