Skip to content

gitaly/server: Fix race checking for expected log entries

The Gitaly server factory tests verify that various parts of the wiring for a newly created server work as expected. One part we try to verify is that the logger we pass is correctly being used. This is done by doing a health check RPC call and then checking that we got the expected log entry.

This is prone to a race though: the log entry we expect to exist is created by our middleware and may thus be created after the client has already observed the result of the RPC call. As a result, it may happen that we do not yet have the log entry at the time of checking.

Fix this race by gracefully stopping the server such that any ongoing requests were drained and thus fully processed.

Closes #3916 (closed)

Merge request reports