Disable unreliable provide cid test.

This commit is contained in:
cheatfate 2020-03-24 10:05:11 +02:00
parent 1f5d994700
commit a2acdd7933
No known key found for this signature in database
GPG Key ID: 46ADD633A7201F95
1 changed files with 24 additions and 24 deletions

View File

@ -40,33 +40,33 @@ proc connectStreamTest(): Future[bool] {.async.} =
await api2.close()
result = true
proc provideCidTest(): Future[bool] {.async.} =
var api1 = await newDaemonApi({DHTFull})
var api2 = await newDaemonApi({DHTFull})
var msg = "ethereum2-beacon-chain"
var bmsg = cast[seq[byte]](msg)
var mh = MultiHash.digest("sha2-256", bmsg)
var cid = Cid.init(CIDv1, multiCodec("dag-pb"), mh)
# proc provideCidTest(): Future[bool] {.async.} =
# var api1 = await newDaemonApi({DHTFull})
# var api2 = await newDaemonApi({DHTFull})
# var msg = "ethereum2-beacon-chain"
# var bmsg = cast[seq[byte]](msg)
# var mh = MultiHash.digest("sha2-256", bmsg)
# var cid = Cid.init(CIDv1, multiCodec("dag-pb"), mh)
var id1 = await api1.identity()
var id2 = await api2.identity()
# var id1 = await api1.identity()
# var id2 = await api2.identity()
await api1.connect(id2.peer, id2.addresses)
# await api1.connect(id2.peer, id2.addresses)
while true:
var peers = await api1.listPeers()
if len(peers) > 0:
break
# while true:
# var peers = await api1.listPeers()
# if len(peers) > 0:
# break
await api1.dhtProvide(cid)
var peers = await api2.dhtFindProviders(cid, 10)
# await api1.dhtProvide(cid)
# var peers = await api2.dhtFindProviders(cid, 10)
if len(peers) == 1:
if peers[0].peer == id1.peer:
result = true
# if len(peers) == 1:
# if peers[0].peer == id1.peer:
# result = true
await api1.close()
await api2.close()
# await api1.close()
# await api2.close()
proc pubsubTest(f: set[P2PDaemonFlags]): Future[bool] {.async.} =
var pubsubData = "TEST MESSAGE"
@ -138,9 +138,9 @@ when isMainModule:
test "Connect/Accept peer/stream test":
check:
waitFor(connectStreamTest()) == true
test "Provide CID test":
check:
waitFor(provideCidTest()) == true
# test "Provide CID test":
# check:
# waitFor(provideCidTest()) == true
test "GossipSub test":
check:
waitFor(pubsubTest({PSGossipSub})) == true