From 9720da5bc8e3f55a08f53e76b28560607270e2a5 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Sat, 18 Feb 2017 15:42:11 -0700 Subject: [PATCH] proxy: Fix race in test --- caddyhttp/proxy/proxy_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/caddyhttp/proxy/proxy_test.go b/caddyhttp/proxy/proxy_test.go index fcb03d5a..386a16b5 100644 --- a/caddyhttp/proxy/proxy_test.go +++ b/caddyhttp/proxy/proxy_test.go @@ -278,8 +278,8 @@ func TestWebSocketReverseProxyServeHTTPHandler(t *testing.T) { if !bytes.Equal(actual, expected) { t.Errorf("Expected backend to accept response:\n'%s'\nActually got:\n'%s'", expected, actual) } - if atomic.LoadInt32(&connCount) != 1 { - t.Errorf("Expected 1 websocket connection, got %d", connCount) + if got, want := atomic.LoadInt32(&connCount), int32(1); got != want { + t.Errorf("Expected %d websocket connection, got %d", want, got) } }