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

fix(tests): Fix macos tests #2539

Draft
wants to merge 3 commits into
base: fix-test-imports
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
21 changes: 21 additions & 0 deletions tests/waku_node/test_wakunode_relay_rln.nim
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@ suite "Waku RlnRelay - End to End":
"WakuRelay protocol is not mounted, cannot mount WakuRlnRelay"

# FIXME: fails on macos
#[
Unhandled defect:
/Users/runner/work/nwaku/nwaku/tests/waku_node/test_wakunode_relay_rln.nim(59, 18)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can probably add a sleep. this is weird since the pr which merged these changes in did not suffer from this. nonceLimit shouldn't be 0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing sleep hypothesis.
In any case, there are three different errors, there might be different origins to them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added some awaits here and there, not in all failing tests, yet this last run hasn't triggered test failures. There's still an exception:

2024-03-20T15:29:25.3026940Z [Summary] 562 tests run (1018.6s): 554 OK, 0 FAILED, 8 SKIPPED
2024-03-20T15:29:25.8017230Z stack trace: (most recent call last)
2024-03-20T15:29:25.8046630Z /Users/runner/work/nwaku/nwaku/vendor/nimbus-build-system/vendor/Nim/lib/system/nimscript.nim(429, 18)
2024-03-20T15:29:25.8050330Z /Users/runner/work/nwaku/nwaku/waku.nimble(82, 8) testTask
2024-03-20T15:29:25.8051690Z /Users/runner/work/nwaku/nwaku/waku.nimble(54, 8) test
2024-03-20T15:29:25.8053620Z /Users/runner/work/nwaku/nwaku/vendor/nimbus-build-system/vendor/Nim/lib/system/nimscript.nim(273, 7) exec
2024-03-20T15:29:25.8057400Z /Users/runner/work/nwaku/nwaku/vendor/nimbus-build-system/vendor/Nim/lib/system/nimscript.nim(273, 7) Error: unhandled exception: FAILED: build/all_tests_waku [OSError]
2024-03-20T15:29:25.8726590Z make: *** [testwaku] Error 1
2024-03-20T15:29:25.9231280Z ##[error]Process completed with exit code 2.

But I can't figure out what it might be related to. Any ideas?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you have to initialize the node properly differently for rln-v1 and v2, please see the test_wakunode_rln_relay.nim test

`appendRlnProofResult.isOk()` could not get new message id to generate an rln proof: NonceLimitReached: Nonce limit reached.
Please wait for the next epoch. requested nonce: 0 & nonceLimit: 0 [AssertionDefect]
]#
asyncTest "Pubsub topics subscribed before mounting RlnRelay are added to it":
# Given the node enables Relay and Rln while subscribing to a pubsub topic
await server.setupRelayWithRln(1.uint, @[pubsubTopic])
Expand Down Expand Up @@ -186,6 +192,11 @@ suite "Waku RlnRelay - End to End":
not isCompleted2

# FIXME: fails on macos
#[
Unhandled defect: /Users/runner/work/nwaku/nwaku/tests/waku_node/test_wakunode_relay_rln.nim(59, 18)
`appendRlnProofResult.isOk()` could not get new message id to generate an rln proof: NonceLimitReached: Nonce limit reached.
Please wait for the next epoch. requested nonce: 0 & nonceLimit: 0 [AssertionDefect]
]#
asyncTest "Pubsub topics subscribed after mounting RlnRelay are added to it":
# Given the node enables Relay and Rln without subscribing to a pubsub topic
await server.setupRelayWithRln(1.uint, @[])
Expand Down Expand Up @@ -223,6 +234,11 @@ suite "Waku RlnRelay - End to End":

suite "Analysis of Bandwith Limitations":
# FIXME: fails on macos
#[
Unhandled defect:
/Users/runner/work/nwaku/nwaku/tests/waku_node/test_wakunode_relay_rln.nim(279, 15)
`client.wakuRlnRelay.appendRLNProof(message1b, epoch + float(client.wakuRlnRelay.rlnEpochSizeSec * 0)).isOk()` [AssertionDefect]
]#
asyncTest "Valid Payload Sizes":
# Given the node enables Relay and Rln while subscribing to a pubsub topic
await server.setupRelayWithRln(1.uint, @[pubsubTopic])
Expand Down Expand Up @@ -310,6 +326,11 @@ suite "Waku RlnRelay - End to End":
check not await completionFut.withTimeout(FUTURE_TIMEOUT_LONG)

# FIXME: fails on macos
#[
Unhandled defect:
/Users/runner/work/nwaku/nwaku/tests/waku_node/test_wakunode_relay_rln.nim(365, 15)
`client.wakuRlnRelay.appendRLNProof(message151kibPlus, epoch + float(client.wakuRlnRelay.rlnEpochSizeSec * 3)).isOk()` [AssertionDefect]
]#
asyncTest "Invalid Payload Sizes":
# Given the node enables Relay and Rln while subscribing to a pubsub topic
await server.setupRelayWithRln(1.uint, @[pubsubTopic])
Expand Down
5 changes: 5 additions & 0 deletions tests/waku_rln_relay/rln/test_wrappers.nim
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ suite "membershipKeyGen":
suite "RlnConfig":
suite "createRLNInstance":
# FIXME: fails on macos
#[
Unhandled defect:
/Users/runner/work/nwaku/nwaku/tests/waku_rln_relay/rln/test_wrappers.nim(109, 22)
`rlnRes.isOk()` error in parameters
]#
test "ok":
# When we create the RLN instance
let rlnRes: RLNResult = createRLNInstance(15, "my.db")
Expand Down
Loading