Skip to content

Consume stream to finish in flaky test

Sami Hiltunen requested to merge smh-fix-flaky-mw-test into master

TestInterceptor/streaming_repository-scoped_call is flaky due to not consuming the gRPC stream to finish. The test server is recording the captured tags after calling the handler. This leads to a race where the test body may assert the tags while the server is storing them.

Fix the race by consuming the stream to finish in the test. This way the interceptor capturing the tags runs to finish before the test asserts the result as the test has to wait for the status to be received first.

While at it, simplify the test handler by removing the unnecessary response sending as it doesn't help with the synchronization.

Closes #5723 (closed)

Merge request reports

Loading