Commit 11776e03 authored by Adin Schmahmann's avatar Adin Schmahmann Committed by Steven Allen

test: switch tests to use dht.bucketSize instead of KValue for queries

parent 19e4d2ea
......@@ -1494,7 +1494,7 @@ func testFindPeerQuery(t *testing.T,
sort.Sort(peer.IDSlice(outpeers))
exp := kb.SortClosestPeers(reachableIds, rtval)[:minInt(KValue, len(reachableIds))]
exp := kb.SortClosestPeers(reachableIds, rtval)[:minInt(guy.bucketSize, len(reachableIds))]
t.Logf("got %d peers", len(outpeers))
got := kb.SortClosestPeers(outpeers, rtval)
......@@ -1519,7 +1519,8 @@ func TestFindClosestPeers(t *testing.T) {
connect(t, ctx, dhts[i], dhts[(i+1)%len(dhts)])
}
peers, err := dhts[1].GetClosestPeers(ctx, "foo")
querier := dhts[1]
peers, err := querier.GetClosestPeers(ctx, "foo")
if err != nil {
t.Fatal(err)
}
......@@ -1529,8 +1530,8 @@ func TestFindClosestPeers(t *testing.T) {
out = append(out, p)
}
if len(out) != KValue {
t.Fatalf("got wrong number of peers (got %d, expected %d)", len(out), KValue)
if len(out) != querier.bucketSize {
t.Fatalf("got wrong number of peers (got %d, expected %d)", len(out), querier.bucketSize)
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment