mirror of https://github.com/waku-org/nwaku.git
chore: improving and temporarily skipping flaky rln test (#3094)
This commit is contained in:
parent
1d2b910f54
commit
a6ed80a55d
|
@ -11,7 +11,7 @@ import
|
||||||
libp2p/protocols/pubsub/pubsub
|
libp2p/protocols/pubsub/pubsub
|
||||||
import
|
import
|
||||||
waku/[waku_core, waku_node, waku_rln_relay],
|
waku/[waku_core, waku_node, waku_rln_relay],
|
||||||
../testlib/[wakucore, futures, wakunode],
|
../testlib/[wakucore, futures, wakunode, testutils],
|
||||||
./rln/waku_rln_relay_utils
|
./rln/waku_rln_relay_utils
|
||||||
|
|
||||||
from std/times import epochTime
|
from std/times import epochTime
|
||||||
|
@ -478,7 +478,7 @@ procSuite "WakuNode - RLN relay":
|
||||||
await node2.stop()
|
await node2.stop()
|
||||||
await node3.stop()
|
await node3.stop()
|
||||||
|
|
||||||
asyncTest "clearNullifierLog: should clear epochs > MaxEpochGap":
|
xasyncTest "clearNullifierLog: should clear epochs > MaxEpochGap":
|
||||||
# Given two nodes
|
# Given two nodes
|
||||||
let
|
let
|
||||||
contentTopic = ContentTopic("/waku/2/default-content/proto")
|
contentTopic = ContentTopic("/waku/2/default-content/proto")
|
||||||
|
@ -542,13 +542,13 @@ procSuite "WakuNode - RLN relay":
|
||||||
|
|
||||||
# Given all messages have an rln proof and are published by the node 1
|
# Given all messages have an rln proof and are published by the node 1
|
||||||
let publishSleepDuration: Duration = 5000.millis
|
let publishSleepDuration: Duration = 5000.millis
|
||||||
let time = epochTime()
|
let startTime = epochTime()
|
||||||
|
|
||||||
# Epoch 1
|
# Epoch 1
|
||||||
node1.wakuRlnRelay.unsafeAppendRLNProof(wm1, time).isOkOr:
|
node1.wakuRlnRelay.unsafeAppendRLNProof(wm1, startTime).isOkOr:
|
||||||
raiseAssert $error
|
raiseAssert $error
|
||||||
# Message wm2 is published in the same epoch as wm1, so it'll be considered spam
|
# Message wm2 is published in the same epoch as wm1, so it'll be considered spam
|
||||||
node1.wakuRlnRelay.unsafeAppendRLNProof(wm2, time).isOkOr:
|
node1.wakuRlnRelay.unsafeAppendRLNProof(wm2, startTime).isOkOr:
|
||||||
raiseAssert $error
|
raiseAssert $error
|
||||||
discard await node1.publish(some(DefaultPubsubTopic), wm1)
|
discard await node1.publish(some(DefaultPubsubTopic), wm1)
|
||||||
discard await node1.publish(some(DefaultPubsubTopic), wm2)
|
discard await node1.publish(some(DefaultPubsubTopic), wm2)
|
||||||
|
@ -558,7 +558,7 @@ procSuite "WakuNode - RLN relay":
|
||||||
node2.wakuRlnRelay.nullifierLog.len() == 1
|
node2.wakuRlnRelay.nullifierLog.len() == 1
|
||||||
|
|
||||||
# Epoch 2
|
# Epoch 2
|
||||||
node1.wakuRlnRelay.unsafeAppendRLNProof(wm3, epochTime()).isOkOr:
|
node1.wakuRlnRelay.unsafeAppendRLNProof(wm3, startTime + float(1 * epochSizeSec)).isOkOr:
|
||||||
raiseAssert $error
|
raiseAssert $error
|
||||||
discard await node1.publish(some(DefaultPubsubTopic), wm3)
|
discard await node1.publish(some(DefaultPubsubTopic), wm3)
|
||||||
await sleepAsync(publishSleepDuration)
|
await sleepAsync(publishSleepDuration)
|
||||||
|
@ -567,7 +567,7 @@ procSuite "WakuNode - RLN relay":
|
||||||
node2.wakuRlnRelay.nullifierLog.len() == 2
|
node2.wakuRlnRelay.nullifierLog.len() == 2
|
||||||
|
|
||||||
# Epoch 3
|
# Epoch 3
|
||||||
node1.wakuRlnRelay.unsafeAppendRLNProof(wm4, epochTime()).isOkOr:
|
node1.wakuRlnRelay.unsafeAppendRLNProof(wm4, startTime + float(2 * epochSizeSec)).isOkOr:
|
||||||
raiseAssert $error
|
raiseAssert $error
|
||||||
discard await node1.publish(some(DefaultPubsubTopic), wm4)
|
discard await node1.publish(some(DefaultPubsubTopic), wm4)
|
||||||
await sleepAsync(publishSleepDuration)
|
await sleepAsync(publishSleepDuration)
|
||||||
|
@ -576,7 +576,7 @@ procSuite "WakuNode - RLN relay":
|
||||||
node2.wakuRlnRelay.nullifierLog.len() == 3
|
node2.wakuRlnRelay.nullifierLog.len() == 3
|
||||||
|
|
||||||
# Epoch 4
|
# Epoch 4
|
||||||
node1.wakuRlnRelay.unsafeAppendRLNProof(wm5, epochTime()).isOkOr:
|
node1.wakuRlnRelay.unsafeAppendRLNProof(wm5, startTime + float(3 * epochSizeSec)).isOkOr:
|
||||||
raiseAssert $error
|
raiseAssert $error
|
||||||
discard await node1.publish(some(DefaultPubsubTopic), wm5)
|
discard await node1.publish(some(DefaultPubsubTopic), wm5)
|
||||||
await sleepAsync(publishSleepDuration)
|
await sleepAsync(publishSleepDuration)
|
||||||
|
@ -585,7 +585,7 @@ procSuite "WakuNode - RLN relay":
|
||||||
node2.wakuRlnRelay.nullifierLog.len() == 4
|
node2.wakuRlnRelay.nullifierLog.len() == 4
|
||||||
|
|
||||||
# Epoch 5
|
# Epoch 5
|
||||||
node1.wakuRlnRelay.unsafeAppendRLNProof(wm6, epochTime()).isOkOr:
|
node1.wakuRlnRelay.unsafeAppendRLNProof(wm6, startTime + float(4 * epochSizeSec)).isOkOr:
|
||||||
raiseAssert $error
|
raiseAssert $error
|
||||||
discard await node1.publish(some(DefaultPubsubTopic), wm6)
|
discard await node1.publish(some(DefaultPubsubTopic), wm6)
|
||||||
await sleepAsync(publishSleepDuration)
|
await sleepAsync(publishSleepDuration)
|
||||||
|
|
Loading…
Reference in New Issue