From 1eff7bc11202e86ae18b58fbaaedd31e010bca14 Mon Sep 17 00:00:00 2001 From: Ivan Kozlovic Date: Mon, 13 May 2019 11:49:29 -0600 Subject: [PATCH] Fixed gateway test race report Signed-off-by: Ivan Kozlovic --- server/gateway_test.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/server/gateway_test.go b/server/gateway_test.go index 3482e044..52ff932b 100644 --- a/server/gateway_test.go +++ b/server/gateway_test.go @@ -2549,10 +2549,7 @@ func TestGatewayMsgSentOnlyOnce(t *testing.T) { if c == nil { t.Fatalf("S1 inbound gateway not found") } - c.mu.Lock() - in := c.inMsgs - c.mu.Unlock() - if in != 1 { + if in := atomic.LoadInt64(&c.inMsgs); in != 1 { t.Fatalf("Expected s1's inbound gateway to have received a single message, got %v", in) } }