Commit b18f84f2 authored by Jacob Vosmaer's avatar Jacob Vosmaer

Remove test gitaly socket before listening

The socket path is / can be deterministic, leading to repeated
failures to open the listener when an old socket was never removed.
parent 3a215f2e
......@@ -201,6 +201,9 @@ func TestPostUploadPackHandledLocallyDueToEmptyGitalySocketPath(t *testing.T) {
func startGitalyServer(t *testing.T, finalMessageCode codes.Code) (*grpc.Server, string) {
socketPath := path.Join(scratchDir, fmt.Sprintf("gitaly-%d.sock", rand.Int()))
if err := os.Remove(socketPath); err != nil && !os.IsNotExist(err) {
t.Fatal(err)
}
server := grpc.NewServer()
listener, err := net.Listen("unix", socketPath)
require.NoError(t, err)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment