Test conn (#199)

* test: add conn tests

* test: add ConnStatus tests

* test: add error test

* test: add more conn tests
This commit is contained in:
Mikhail Bragin
2022-01-21 13:52:19 +01:00
committed by GitHub
parent dfa67410b5
commit 2ad899b066
8 changed files with 245 additions and 9 deletions

View File

@ -193,7 +193,15 @@ func (e *Engine) removePeer(peerKey string) error {
conn, exists := e.peerConns[peerKey]
if exists {
delete(e.peerConns, peerKey)
return conn.Close()
err := conn.Close()
if err != nil {
switch err.(type) {
case *peer.ConnectionAlreadyClosedError:
return nil
default:
return err
}
}
}
return nil
}