Skip to content

Commit

Permalink
updated TestRTEvictionOnFailedQuery
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumemichel committed Aug 8, 2024
1 parent f7d06b1 commit 4667e81
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@ func TestRTEvictionOnFailedQuery(t *testing.T) {
// peers should be in the RT because of fixLowPeers
require.NoError(t, tu.WaitFor(ctx, func() error {
if !checkRoutingTable(d1, d2) {
return fmt.Errorf("should have routes 0")
return fmt.Errorf("should have routes")
}
return nil
}))

// close both hosts so query fails
require.NoError(t, d1.host.Close())
require.NoError(t, d2.host.Close())
// peers will still be in the RT because we have decoupled membership from connectivity
// clear the addresses of the peers so that the next queries fail
d1.host.Peerstore().ClearAddrs(d2.self)
d2.host.Peerstore().ClearAddrs(d1.self)
// peers will still be in the RT because RT is decoupled with the host and peerstore
require.NoError(t, tu.WaitFor(ctx, func() error {
if !checkRoutingTable(d1, d2) {
return fmt.Errorf("should have routes 1")
return fmt.Errorf("should have routes")
}
return nil
}))
Expand All @@ -59,7 +59,7 @@ func TestRTEvictionOnFailedQuery(t *testing.T) {

require.NoError(t, tu.WaitFor(ctx, func() error {
if checkRoutingTable(d1, d2) {
return fmt.Errorf("should not have routes 2")
return fmt.Errorf("should not have routes")
}
return nil
}))
Expand Down

0 comments on commit 4667e81

Please sign in to comment.