From cf05136643292b1326a3a681622b5cf06ca245b3 Mon Sep 17 00:00:00 2001 From: Elizabeth Mayer Date: Wed, 9 Aug 2023 22:07:53 -0700 Subject: [PATCH] Update server.go to reduce race condition in test suite Change the udpErr and tcpErr to close earlier to reduce liklihood of race condition in test suite where TestClient_Auth, TestClient_Healthcheck, and TestClient_TcpKeyMatch/returns_ordered_keys_with_secret fail because the udp address is detected as already being in use. --- server/server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/server.go b/server/server.go index 2c6ae40..813dfc4 100644 --- a/server/server.go +++ b/server/server.go @@ -132,11 +132,11 @@ func (s *Server) Close() error { return nil } s.disposed = true + udpErr := s.conn.Close() + tcpErr := s.tcpConn.Close() s.store.DisableCleanup() close(s.messageProcessing) - udpErr := s.conn.Close() - tcpErr := s.tcpConn.Close() if udpErr != nil { return udpErr