func createSocketServer(t *testing.T) (string, net.Listener) { socketFile := tt.TempFile(t) tt.TestExpectSuccess(t, os.Remove(socketFile)) l, err := net.Listen("unix", socketFile) tt.TestExpectSuccess(t, err) return socketFile, l }
func TestClient_WaitForSocket(t *testing.T) { tt.StartTest(t) defer tt.FinishTest(t) socketFile := tt.TempFile(t) tt.TestExpectSuccess(t, os.Remove(socketFile)) client := New(socketFile) err := client.WaitForSocket(10 * time.Millisecond) tt.TestExpectError(t, err) f, err := os.Create(socketFile) tt.TestExpectSuccess(t, err) f.Close() err = client.WaitForSocket(10 * time.Millisecond) tt.TestExpectSuccess(t, err) }