mirror of
https://github.com/fluencelabs/go-libp2p-kad-dht
synced 2025-06-26 03:01:39 +00:00
rewrite of provides to better select peers to send RPCs to
refactor test peer creation to be deterministic and reliable a bit of cleanup trying to figure out TestGetFailure add test to verify deterministic peer creation switch put RPC over to use getClosestPeers rm 0xDEADC0DE fix queries not searching peer if its not actually closer
This commit is contained in:
@ -47,9 +47,8 @@ func TestGetFailures(t *testing.T) {
|
||||
t.Fatal("Did not get expected error!")
|
||||
}
|
||||
|
||||
msgs := make(chan *pb.Message, 100)
|
||||
t.Log("Timeout test passed.")
|
||||
|
||||
// u.POut("NotFound Test\n")
|
||||
// Reply with failures to every message
|
||||
nets[1].SetHandler(inet.ProtocolDHT, func(s inet.Stream) {
|
||||
defer s.Close()
|
||||
@ -68,8 +67,6 @@ func TestGetFailures(t *testing.T) {
|
||||
if err := pbw.WriteMsg(resp); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
msgs <- resp
|
||||
})
|
||||
|
||||
// This one should fail with NotFound
|
||||
@ -83,6 +80,8 @@ func TestGetFailures(t *testing.T) {
|
||||
t.Fatal("expected error, got none.")
|
||||
}
|
||||
|
||||
t.Log("ErrNotFound check passed!")
|
||||
|
||||
// Now we test this DHT's handleGetValue failure
|
||||
{
|
||||
typ := pb.Message_GET_VALUE
|
||||
|
Reference in New Issue
Block a user