fix race conditions in tests

This commit is contained in:
Ethan Buchman
2016-06-21 14:35:29 -04:00
parent 5bd7692323
commit 981c6868ad
3 changed files with 10 additions and 6 deletions

View File

@ -181,8 +181,8 @@ func (sw *Switch) OnStop() {
// Stop peers
for _, peer := range sw.peers.List() {
peer.Stop()
sw.peers.Remove(peer)
}
sw.peers = NewPeerSet()
// Stop reactors
for _, reactor := range sw.reactors {
reactor.Stop()