Skip to content

Commit

Permalink
Merge pull request #128 from kzys/check-shutdown
Browse files Browse the repository at this point in the history
Make checkServerShutdown verbose
  • Loading branch information
estesp authored Jan 27, 2023
2 parents 5cc9169 + ca27f48 commit 32fab23
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -487,12 +487,23 @@ func checkServerShutdown(t *testing.T, server *Server) {
t.Helper()
server.mu.Lock()
defer server.mu.Unlock()

if len(server.listeners) > 0 {
t.Fatalf("expected listeners to be empty: %v", server.listeners)
t.Errorf("expected listeners to be empty: %v", server.listeners)
}
for listener := range server.listeners {
t.Logf("listener addr=%s", listener.Addr())
}

if len(server.connections) > 0 {
t.Fatalf("expected connections to be empty: %v", server.connections)
t.Errorf("expected connections to be empty: %v", server.connections)
}
for conn := range server.connections {
state, ok := conn.getState()
if !ok {
t.Errorf("failed to get state from %v", conn)
}
t.Logf("conn state=%s", state)
}
}

Expand Down

0 comments on commit 32fab23

Please sign in to comment.