Skip to content

testserver: Use GracefulStop in test cleanup

James Liu requested to merge jliu-testserver-graceful-stop into master

#5966 (closed)

When we run Gitaly for tests, we start separate gRPC servers for internal and external traffic. The internal server is used to handle traffic from executing hooks. It's important to close the external server before the internal one to prevent new requests from being accepted. These requests may fail in-flight due to the internal server being shut down.

Adjust the cleanup callback for the test server so we perform a graceful shutdown for all servers spawned by the server factory. This simplifies the code somewhat, and moves the responsibility of shutdown order to the server factory.

The TestProcReceiveHook test was quarantined due to a failure where the test's storage directory couldn't be removed as new files were being written into it.

Hopefully, using a graceful shutdown in the previous commit ensures the test server has completed all operations by the time the cleanup happens.

Edited by James Liu

Merge request reports