Fix tests of #638
This commit is contained in:
parent
fd59cbc7a9
commit
f98bf612bd
|
@ -574,7 +574,8 @@ suite "GossipSub":
|
||||||
let
|
let
|
||||||
nodes = generateNodes(
|
nodes = generateNodes(
|
||||||
2,
|
2,
|
||||||
gossip = true)
|
gossip = true,
|
||||||
|
unsubscribeBackoff = 10.minutes)
|
||||||
|
|
||||||
# start switches
|
# start switches
|
||||||
nodesFut = await allFinished(
|
nodesFut = await allFinished(
|
||||||
|
|
|
@ -40,6 +40,7 @@ proc generateNodes*(
|
||||||
verifySignature: bool = libp2p_pubsub_verify,
|
verifySignature: bool = libp2p_pubsub_verify,
|
||||||
anonymize: bool = libp2p_pubsub_anonymize,
|
anonymize: bool = libp2p_pubsub_anonymize,
|
||||||
sign: bool = libp2p_pubsub_sign,
|
sign: bool = libp2p_pubsub_sign,
|
||||||
|
unsubscribeBackoff = 1.seconds,
|
||||||
maxMessageSize: int = 1024 * 1024): seq[PubSub] =
|
maxMessageSize: int = 1024 * 1024): seq[PubSub] =
|
||||||
|
|
||||||
for i in 0..<num:
|
for i in 0..<num:
|
||||||
|
@ -53,7 +54,7 @@ proc generateNodes*(
|
||||||
msgIdProvider = msgIdProvider,
|
msgIdProvider = msgIdProvider,
|
||||||
anonymize = anonymize,
|
anonymize = anonymize,
|
||||||
maxMessageSize = maxMessageSize,
|
maxMessageSize = maxMessageSize,
|
||||||
parameters = (var p = GossipSubParams.init(); p.floodPublish = false; p.historyLength = 20; p.historyGossip = 20; p.unsubscribeBackoff = 1.seconds; p))
|
parameters = (var p = GossipSubParams.init(); p.floodPublish = false; p.historyLength = 20; p.historyGossip = 20; p.unsubscribeBackoff = unsubscribeBackoff; p))
|
||||||
# set some testing params, to enable scores
|
# set some testing params, to enable scores
|
||||||
g.topicParams.mgetOrPut("foobar", TopicParams.init()).topicWeight = 1.0
|
g.topicParams.mgetOrPut("foobar", TopicParams.init()).topicWeight = 1.0
|
||||||
g.topicParams.mgetOrPut("foo", TopicParams.init()).topicWeight = 1.0
|
g.topicParams.mgetOrPut("foo", TopicParams.init()).topicWeight = 1.0
|
||||||
|
|
Loading…
Reference in New Issue