Skip to content

Commit

Permalink
Merge pull request ipfs#433 from aarshkshah1992/fix/flaky-TestEmptyTa…
Browse files Browse the repository at this point in the history
…ble-test

Fix flaky TestEmptyTableTest
  • Loading branch information
Stebalien authored Dec 20, 2019
2 parents a06b327 + b19ac72 commit 6c4cd42
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dht_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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])
}
Expand Down

0 comments on commit 6c4cd42

Please sign in to comment.