Skip to content
Snippets Groups Projects
Commit b18f84f2 authored by Jacob Vosmaer (GitLab)'s avatar Jacob Vosmaer (GitLab)
Browse files

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
No related branches found
No related tags found
1 merge request!160Gitaly stream interruption tests
Loading
Loading
@@ -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)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment