now also testing client removal.
This commit is contained in:
parent
d8a79fbe00
commit
739556e938
@ -190,11 +190,16 @@ func (s *AdminTestSuite) Test_connectClient() {
|
||||
s.Equal(1, len(state.Clients))
|
||||
s.Equal(clientConn.Info, state.Clients[clientConn.Info.Guid])
|
||||
|
||||
// will close the connections and as a result also th synchronize goroutine.
|
||||
s.cancelFunc()
|
||||
|
||||
// Note: removing agents and clients after connection loss is the responsibility of the MatchMaker
|
||||
// Here we only test explicit removal of the agents and clients.
|
||||
// removing the client will close all connections, we test this by writing to the connections
|
||||
// after removing the client.
|
||||
s.admin.RemoveClient(clientConn)
|
||||
buf := make([]byte, 10)
|
||||
_, err := clientConn.clientConnection.Write(buf)
|
||||
s.NotNil(err)
|
||||
s.True(strings.Contains(err.Error(), "closed"))
|
||||
_, err = clientConn.agentConnection.Write(buf)
|
||||
s.NotNil(err)
|
||||
s.True(strings.Contains(err.Error(), "closed"))
|
||||
}
|
||||
|
||||
func (s *AdminTestSuite) Test_multipleAgentsAndClients() {
|
||||
|
Loading…
Reference in New Issue
Block a user