Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: improving and temporarily skipping flaky rln test #3094

Merged
merged 4 commits into from
Oct 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions tests/waku_rln_relay/test_wakunode_rln_relay.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import
libp2p/protocols/pubsub/pubsub
import
waku/[waku_core, waku_node, waku_rln_relay],
../testlib/[wakucore, futures, wakunode],
../testlib/[wakucore, futures, wakunode, testutils],
./rln/waku_rln_relay_utils

from std/times import epochTime
Expand Down Expand Up @@ -478,7 +478,7 @@ procSuite "WakuNode - RLN relay":
await node2.stop()
await node3.stop()

asyncTest "clearNullifierLog: should clear epochs > MaxEpochGap":
xasyncTest "clearNullifierLog: should clear epochs > MaxEpochGap":
# Given two nodes
let
contentTopic = ContentTopic("/waku/2/default-content/proto")
Expand Down Expand Up @@ -542,13 +542,13 @@ procSuite "WakuNode - RLN relay":

# Given all messages have an rln proof and are published by the node 1
let publishSleepDuration: Duration = 5000.millis
let time = epochTime()
let startTime = epochTime()

# Epoch 1
node1.wakuRlnRelay.unsafeAppendRLNProof(wm1, time).isOkOr:
node1.wakuRlnRelay.unsafeAppendRLNProof(wm1, startTime).isOkOr:
raiseAssert $error
# 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
discard await node1.publish(some(DefaultPubsubTopic), wm1)
discard await node1.publish(some(DefaultPubsubTopic), wm2)
Expand All @@ -558,7 +558,7 @@ procSuite "WakuNode - RLN relay":
node2.wakuRlnRelay.nullifierLog.len() == 1

# Epoch 2
node1.wakuRlnRelay.unsafeAppendRLNProof(wm3, epochTime()).isOkOr:
node1.wakuRlnRelay.unsafeAppendRLNProof(wm3, startTime + float(1 * epochSizeSec)).isOkOr:
raiseAssert $error
discard await node1.publish(some(DefaultPubsubTopic), wm3)
await sleepAsync(publishSleepDuration)
Expand All @@ -567,7 +567,7 @@ procSuite "WakuNode - RLN relay":
node2.wakuRlnRelay.nullifierLog.len() == 2

# Epoch 3
node1.wakuRlnRelay.unsafeAppendRLNProof(wm4, epochTime()).isOkOr:
node1.wakuRlnRelay.unsafeAppendRLNProof(wm4, startTime + float(2 * epochSizeSec)).isOkOr:
raiseAssert $error
discard await node1.publish(some(DefaultPubsubTopic), wm4)
await sleepAsync(publishSleepDuration)
Expand All @@ -576,7 +576,7 @@ procSuite "WakuNode - RLN relay":
node2.wakuRlnRelay.nullifierLog.len() == 3

# Epoch 4
node1.wakuRlnRelay.unsafeAppendRLNProof(wm5, epochTime()).isOkOr:
node1.wakuRlnRelay.unsafeAppendRLNProof(wm5, startTime + float(3 * epochSizeSec)).isOkOr:
raiseAssert $error
discard await node1.publish(some(DefaultPubsubTopic), wm5)
await sleepAsync(publishSleepDuration)
Expand All @@ -585,7 +585,7 @@ procSuite "WakuNode - RLN relay":
node2.wakuRlnRelay.nullifierLog.len() == 4

# Epoch 5
node1.wakuRlnRelay.unsafeAppendRLNProof(wm6, epochTime()).isOkOr:
node1.wakuRlnRelay.unsafeAppendRLNProof(wm6, startTime + float(4 * epochSizeSec)).isOkOr:
raiseAssert $error
discard await node1.publish(some(DefaultPubsubTopic), wm6)
await sleepAsync(publishSleepDuration)
Expand Down
Loading