From 07f1d62a98eef6fa24937483c27c4c9dd8fe8d85 Mon Sep 17 00:00:00 2001 From: Samuel Stauffer Date: Tue, 30 Jan 2018 11:37:22 -0800 Subject: [PATCH] Fix race conditions in t test --- zk/conn_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zk/conn_test.go b/zk/conn_test.go index ed4a7706..32e78503 100644 --- a/zk/conn_test.go +++ b/zk/conn_test.go @@ -30,7 +30,7 @@ func TestRecurringReAuthHang(t *testing.T) { if err != nil { panic(err) } - for conn.state != StateHasSession { + for conn.State() != StateHasSession { time.Sleep(50 * time.Millisecond) } @@ -40,7 +40,7 @@ func TestRecurringReAuthHang(t *testing.T) { }() // Add auth. - conn.creds = append(conn.creds, authCreds{"digest", []byte("test:test")}) + conn.AddAuth("digest", []byte("test:test")) currentServer := conn.server conn.debugCloseRecvLoop = true