routing table should not have all the peers

This commit is contained in:
Aarsh Shah 2019-12-20 15:03:31 +08:00
parent a06b32768e
commit b19ac720dd

View File

@ -805,7 +805,7 @@ func TestEmptyTable(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
nDHTs := 50 // needs more than 40 peers so we don't add all of them to our routing table.
nDHTs := 50
dhts := setupDHTS(t, ctx, nDHTs)
defer func() {
for _, dht := range dhts {
@ -837,6 +837,10 @@ func TestEmptyTable(t *testing.T) {
oldSize = newSize
}
// remove any one peer from the RT so we don't end up disconnecting all of them if the RT
// already has all peers we are connected to
dhts[0].routingTable.Remove(dhts[0].routingTable.ListPeers()[0])
if u.Debug {
printRoutingTables(dhts[:1])
}