Skip to content

Commit

Permalink
Update server.go to reduce race condition in test suite
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
eamayer committed Aug 10, 2023
1 parent c77e101 commit cf05136
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cf05136

Please sign in to comment.