99 u "github.com/ipfs/go-ipfs-util"
1010 "github.com/libp2p/go-libp2p-core/network"
1111 "github.com/libp2p/go-libp2p-core/peer"
12+ peerstore "github.com/libp2p/go-libp2p-core/peerstore"
1213 dht "github.com/libp2p/go-libp2p-kad-dht"
1314 test "github.com/libp2p/go-libp2p-kad-dht/internal/testing"
14- peerstore "github.com/libp2p/go-libp2p-peerstore"
1515 record "github.com/libp2p/go-libp2p-record"
1616 swarmt "github.com/libp2p/go-libp2p-swarm/testing"
1717 bhost "github.com/libp2p/go-libp2p/p2p/host/basic"
@@ -189,6 +189,8 @@ func TestFindProviderAsync(t *testing.T) {
189189 defer wan .Close ()
190190 defer lan .Close ()
191191
192+ time .Sleep (5 * time .Millisecond )
193+
192194 if err := wan .Provide (ctx , wancid , false ); err != nil {
193195 t .Fatal (err )
194196 }
@@ -227,6 +229,8 @@ func TestValueGetSet(t *testing.T) {
227229 defer wan .Close ()
228230 defer lan .Close ()
229231
232+ time .Sleep (5 * time .Millisecond )
233+
230234 err := d .PutValue (ctx , "/v/hello" , []byte ("valid" ))
231235 if err != nil {
232236 t .Fatal (err )
@@ -239,7 +243,7 @@ func TestValueGetSet(t *testing.T) {
239243 t .Fatal ("failed to get expected string." )
240244 }
241245
242- val , err = lan .GetValue (ctx , "/v/hello" )
246+ _ , err = lan .GetValue (ctx , "/v/hello" )
243247 if err == nil {
244248 t .Fatal (err )
245249 }
@@ -257,7 +261,7 @@ func TestSearchValue(t *testing.T) {
257261 d .WAN .Validator .(record.NamespacedValidator )["v" ] = test.TestValidator {}
258262 d .LAN .Validator .(record.NamespacedValidator )["v" ] = test.TestValidator {}
259263
260- err : = wan .PutValue (ctx , "/v/hello" , []byte ("valid" ))
264+ _ = wan .PutValue (ctx , "/v/hello" , []byte ("valid" ))
261265
262266 valCh , err := d .SearchValue (ctx , "/v/hello" , dht .Quorum (0 ))
263267 if err != nil {
@@ -310,6 +314,8 @@ func TestGetPublicKey(t *testing.T) {
310314 defer wan .Close ()
311315 defer lan .Close ()
312316
317+ time .Sleep (5 * time .Millisecond )
318+
313319 pk , err := d .GetPublicKey (ctx , wan .PeerID ())
314320 if err != nil {
315321 t .Fatal (err )
@@ -344,6 +350,8 @@ func TestFindPeer(t *testing.T) {
344350 defer wan .Close ()
345351 defer lan .Close ()
346352
353+ time .Sleep (5 * time .Millisecond )
354+
347355 p , err := d .FindPeer (ctx , lan .PeerID ())
348356 if err != nil {
349357 t .Fatal (err )
0 commit comments