chore: remove flaky test debug logs from rln and store tests (#3303)

* chore: remove flaky test debug logs from rln tests
* Remove flaky test logs from store and legacy store tests
This commit is contained in:
NagyZoltanPeter 2025-02-28 15:36:50 +01:00 committed by GitHub
parent 798b4bb57b
commit 92f893987f
3 changed files with 9 additions and 74 deletions

View File

@ -487,7 +487,6 @@ procSuite "WakuNode - RLN relay":
await node3.stop() await node3.stop()
asyncTest "clearNullifierLog: should clear epochs > MaxEpochGap": asyncTest "clearNullifierLog: should clear epochs > MaxEpochGap":
debug "tmp debug log analyze flaky test"
# Given two nodes # Given two nodes
let let
contentTopic = ContentTopic("/waku/2/default-content/proto") contentTopic = ContentTopic("/waku/2/default-content/proto")
@ -502,18 +501,15 @@ procSuite "WakuNode - RLN relay":
await node1.mountRelay(shardSeq) await node1.mountRelay(shardSeq)
let wakuRlnConfig1 = buildWakuRlnConfig(1, epochSizeSec, "wakunode_10") let wakuRlnConfig1 = buildWakuRlnConfig(1, epochSizeSec, "wakunode_10")
await node1.mountRlnRelay(wakuRlnConfig1) await node1.mountRlnRelay(wakuRlnConfig1)
debug "tmp debug log analyze flaky test"
# Mount rlnrelay in node2 in off-chain mode # Mount rlnrelay in node2 in off-chain mode
await node2.mountRelay(@[DefaultRelayShard]) await node2.mountRelay(@[DefaultRelayShard])
let wakuRlnConfig2 = buildWakuRlnConfig(2, epochSizeSec, "wakunode_11") let wakuRlnConfig2 = buildWakuRlnConfig(2, epochSizeSec, "wakunode_11")
await node2.mountRlnRelay(wakuRlnConfig2) await node2.mountRlnRelay(wakuRlnConfig2)
debug "tmp debug log analyze flaky test"
# Given the two nodes are started and connected # Given the two nodes are started and connected
waitFor allFutures(node1.start(), node2.start()) waitFor allFutures(node1.start(), node2.start())
await node1.connectToNodes(@[node2.switch.peerInfo.toRemotePeerInfo()]) await node1.connectToNodes(@[node2.switch.peerInfo.toRemotePeerInfo()])
debug "tmp debug log analyze flaky test"
# Given some messages # Given some messages
var var
@ -550,9 +546,7 @@ procSuite "WakuNode - RLN relay":
if msg == wm6: if msg == wm6:
completionFut6.complete(true) completionFut6.complete(true)
debug "tmp debug log analyze flaky test"
node2.subscribe((kind: PubsubSub, topic: DefaultPubsubTopic), some(relayHandler)) node2.subscribe((kind: PubsubSub, topic: DefaultPubsubTopic), some(relayHandler))
debug "tmp debug log analyze flaky test"
# 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
@ -561,103 +555,70 @@ procSuite "WakuNode - RLN relay":
# Epoch 1 # Epoch 1
node1.wakuRlnRelay.unsafeAppendRLNProof(wm1, startTime).isOkOr: node1.wakuRlnRelay.unsafeAppendRLNProof(wm1, startTime).isOkOr:
raiseAssert $error raiseAssert $error
debug "tmp debug log analyze flaky test"
# 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, startTime).isOkOr: node1.wakuRlnRelay.unsafeAppendRLNProof(wm2, startTime).isOkOr:
raiseAssert $error raiseAssert $error
debug "tmp debug log analyze flaky test"
discard await node1.publish(some(DefaultPubsubTopic), wm1) discard await node1.publish(some(DefaultPubsubTopic), wm1)
debug "tmp debug log analyze flaky test"
discard await node1.publish(some(DefaultPubsubTopic), wm2) discard await node1.publish(some(DefaultPubsubTopic), wm2)
debug "tmp debug log analyze flaky test"
await sleepAsync(publishSleepDuration) await sleepAsync(publishSleepDuration)
debug "tmp debug log analyze flaky test"
check: check:
await node1.waitForNullifierLog(0) await node1.waitForNullifierLog(0)
debug "tmp debug log analyze flaky test"
check:
await node2.waitForNullifierLog(1) await node2.waitForNullifierLog(1)
# Epoch 2 # Epoch 2
debug "tmp debug log analyze flaky test"
node1.wakuRlnRelay.unsafeAppendRLNProof(wm3, startTime + float(1 * epochSizeSec)).isOkOr: node1.wakuRlnRelay.unsafeAppendRLNProof(wm3, startTime + float(1 * epochSizeSec)).isOkOr:
raiseAssert $error raiseAssert $error
debug "tmp debug log analyze flaky test"
discard await node1.publish(some(DefaultPubsubTopic), wm3) discard await node1.publish(some(DefaultPubsubTopic), wm3)
debug "tmp debug log analyze flaky test"
await sleepAsync(publishSleepDuration) await sleepAsync(publishSleepDuration)
debug "tmp debug log analyze flaky test"
check: check:
await node1.waitForNullifierLog(0) await node1.waitForNullifierLog(0)
debug "tmp debug log analyze flaky test"
check:
await node2.waitForNullifierLog(2) await node2.waitForNullifierLog(2)
debug "tmp debug log analyze flaky test"
# Epoch 3 # Epoch 3
node1.wakuRlnRelay.unsafeAppendRLNProof(wm4, startTime + float(2 * epochSizeSec)).isOkOr: node1.wakuRlnRelay.unsafeAppendRLNProof(wm4, startTime + float(2 * epochSizeSec)).isOkOr:
raiseAssert $error raiseAssert $error
debug "tmp debug log analyze flaky test"
discard await node1.publish(some(DefaultPubsubTopic), wm4) discard await node1.publish(some(DefaultPubsubTopic), wm4)
debug "tmp debug log analyze flaky test"
await sleepAsync(publishSleepDuration) await sleepAsync(publishSleepDuration)
debug "tmp debug log analyze flaky test"
check: check:
await node1.waitForNullifierLog(0) await node1.waitForNullifierLog(0)
debug "tmp debug log analyze flaky test"
check:
await node2.waitForNullifierLog(3) await node2.waitForNullifierLog(3)
debug "tmp debug log analyze flaky test"
# Epoch 4 # Epoch 4
node1.wakuRlnRelay.unsafeAppendRLNProof(wm5, startTime + float(3 * epochSizeSec)).isOkOr: node1.wakuRlnRelay.unsafeAppendRLNProof(wm5, startTime + float(3 * epochSizeSec)).isOkOr:
raiseAssert $error raiseAssert $error
debug "tmp debug log analyze flaky test"
discard await node1.publish(some(DefaultPubsubTopic), wm5) discard await node1.publish(some(DefaultPubsubTopic), wm5)
debug "tmp debug log analyze flaky test"
await sleepAsync(publishSleepDuration) await sleepAsync(publishSleepDuration)
debug "tmp debug log analyze flaky test"
check: check:
await node1.waitForNullifierLog(0) await node1.waitForNullifierLog(0)
debug "tmp debug log analyze flaky test"
check:
await node2.waitForNullifierLog(4) await node2.waitForNullifierLog(4)
debug "tmp debug log analyze flaky test"
# Epoch 5 # Epoch 5
node1.wakuRlnRelay.unsafeAppendRLNProof(wm6, startTime + float(4 * epochSizeSec)).isOkOr: node1.wakuRlnRelay.unsafeAppendRLNProof(wm6, startTime + float(4 * epochSizeSec)).isOkOr:
raiseAssert $error raiseAssert $error
debug "tmp debug log analyze flaky test"
discard await node1.publish(some(DefaultPubsubTopic), wm6) discard await node1.publish(some(DefaultPubsubTopic), wm6)
debug "tmp debug log analyze flaky test"
await sleepAsync(publishSleepDuration) await sleepAsync(publishSleepDuration)
debug "tmp debug log analyze flaky test"
check: check:
await node1.waitForNullifierLog(0) await node1.waitForNullifierLog(0)
debug "tmp debug log analyze flaky test"
check:
await node2.waitForNullifierLog(4) await node2.waitForNullifierLog(4)
# Then the node 2 should have cleared the nullifier log for epochs > MaxEpochGap # Then the node 2 should have cleared the nullifier log for epochs > MaxEpochGap
# Therefore, with 4 max epochs, the first 4 messages will be published (except wm2, which shares epoch with wm1) # Therefore, with 4 max epochs, the first 4 messages will be published (except wm2, which shares epoch with wm1)
check: check:
(await completionFut1.waitForResult()).value() == true (await completionFut1.waitForResult()).value() == true
debug "tmp debug log analyze flaky test"
check:
(await completionFut2.waitForResult()).isErr() (await completionFut2.waitForResult()).isErr()
debug "tmp debug log analyze flaky test"
check:
(await completionFut3.waitForResult()).value() == true (await completionFut3.waitForResult()).value() == true
debug "tmp debug log analyze flaky test"
check:
(await completionFut4.waitForResult()).value() == true (await completionFut4.waitForResult()).value() == true
debug "tmp debug log analyze flaky test"
check:
(await completionFut5.waitForResult()).value() == true (await completionFut5.waitForResult()).value() == true
debug "tmp debug log analyze flaky test"
check:
(await completionFut6.waitForResult()).value() == true (await completionFut6.waitForResult()).value() == true
debug "tmp debug log analyze flaky test"
# Cleanup # Cleanup
waitFor allFutures(node1.stop(), node2.stop()) waitFor allFutures(node1.stop(), node2.stop())

View File

@ -17,15 +17,12 @@ import
suite "Waku Store - query handler": suite "Waku Store - query handler":
asyncTest "history query handler should be called": asyncTest "history query handler should be called":
info "check point" # log added to track flaky test
## Setup ## Setup
let let
serverSwitch = newTestSwitch() serverSwitch = newTestSwitch()
clientSwitch = newTestSwitch() clientSwitch = newTestSwitch()
info "check point" # log added to track flaky test
await allFutures(serverSwitch.start(), clientSwitch.start()) await allFutures(serverSwitch.start(), clientSwitch.start())
info "check point" # log added to track flaky test
## Given ## Given
let serverPeerInfo = serverSwitch.peerInfo.toRemotePeerInfo() let serverPeerInfo = serverSwitch.peerInfo.toRemotePeerInfo()
@ -55,9 +52,7 @@ suite "Waku Store - query handler":
) )
## When ## When
info "check point" # log added to track flaky test
let queryRes = await client.query(req, peer = serverPeerInfo) let queryRes = await client.query(req, peer = serverPeerInfo)
info "check point" # log added to track flaky test
## Then ## Then
check: check:
@ -74,20 +69,15 @@ suite "Waku Store - query handler":
response.messages == @[kv] response.messages == @[kv]
## Cleanup ## Cleanup
info "check point" # log added to track flaky test
await allFutures(serverSwitch.stop(), clientSwitch.stop()) await allFutures(serverSwitch.stop(), clientSwitch.stop())
info "check point" # log added to track flaky test
asyncTest "history query handler should be called and return an error": asyncTest "history query handler should be called and return an error":
info "check point" # log added to track flaky test
## Setup ## Setup
let let
serverSwitch = newTestSwitch() serverSwitch = newTestSwitch()
clientSwitch = newTestSwitch() clientSwitch = newTestSwitch()
info "check point" # log added to track flaky test
await allFutures(serverSwitch.start(), clientSwitch.start()) await allFutures(serverSwitch.start(), clientSwitch.start())
info "check point" # log added to track flaky test
## Given ## Given
let serverPeerInfo = serverSwitch.peerInfo.toRemotePeerInfo() let serverPeerInfo = serverSwitch.peerInfo.toRemotePeerInfo()
@ -126,6 +116,4 @@ suite "Waku Store - query handler":
error.kind == ErrorCode.BAD_REQUEST error.kind == ErrorCode.BAD_REQUEST
## Cleanup ## Cleanup
info "check point" # log added to track flaky test
await allFutures(serverSwitch.stop(), clientSwitch.stop()) await allFutures(serverSwitch.stop(), clientSwitch.stop())
info "check point" # log added to track flaky test

View File

@ -15,19 +15,15 @@ import
suite "Waku Store - query handler legacy": suite "Waku Store - query handler legacy":
asyncTest "history query handler should be called": asyncTest "history query handler should be called":
info "check point" # log added to track flaky test
## Setup ## Setup
let let
serverSwitch = newTestSwitch() serverSwitch = newTestSwitch()
clientSwitch = newTestSwitch() clientSwitch = newTestSwitch()
info "check point" # log added to track flaky test
await allFutures(serverSwitch.start(), clientSwitch.start()) await allFutures(serverSwitch.start(), clientSwitch.start())
info "check point" # log added to track flaky test
## Given ## Given
let serverPeerInfo = serverSwitch.peerInfo.toRemotePeerInfo() let serverPeerInfo = serverSwitch.peerInfo.toRemotePeerInfo()
info "check point" # log added to track flaky test
let msg = fakeWakuMessage(contentTopic = DefaultContentTopic) let msg = fakeWakuMessage(contentTopic = DefaultContentTopic)
@ -50,9 +46,7 @@ suite "Waku Store - query handler legacy":
) )
## When ## When
info "check point" # log added to track flaky test
let queryRes = await client.query(req, peer = serverPeerInfo) let queryRes = await client.query(req, peer = serverPeerInfo)
info "check point" # log added to track flaky test
## Then ## Then
check: check:
@ -69,19 +63,15 @@ suite "Waku Store - query handler legacy":
response.messages == @[msg] response.messages == @[msg]
## Cleanup ## Cleanup
info "check point" # log added to track flaky test
await allFutures(serverSwitch.stop(), clientSwitch.stop()) await allFutures(serverSwitch.stop(), clientSwitch.stop())
info "check point" # log added to track flaky test
asyncTest "history query handler should be called and return an error": asyncTest "history query handler should be called and return an error":
info "check point" # log added to track flaky test
## Setup ## Setup
let let
serverSwitch = newTestSwitch() serverSwitch = newTestSwitch()
clientSwitch = newTestSwitch() clientSwitch = newTestSwitch()
await allFutures(serverSwitch.start(), clientSwitch.start()) await allFutures(serverSwitch.start(), clientSwitch.start())
info "check point" # log added to track flaky test
## Given ## Given
let serverPeerInfo = serverSwitch.peerInfo.toRemotePeerInfo() let serverPeerInfo = serverSwitch.peerInfo.toRemotePeerInfo()
@ -103,10 +93,8 @@ suite "Waku Store - query handler legacy":
requestId: "reqId", requestId: "reqId",
) )
info "check point" # log added to track flaky test
## When ## When
let queryRes = await client.query(req, peer = serverPeerInfo) let queryRes = await client.query(req, peer = serverPeerInfo)
info "check point" # log added to track flaky test
## Then ## Then
check: check:
@ -122,6 +110,4 @@ suite "Waku Store - query handler legacy":
error.kind == HistoryErrorKind.BAD_REQUEST error.kind == HistoryErrorKind.BAD_REQUEST
## Cleanup ## Cleanup
info "check point" # log added to track flaky test
await allFutures(serverSwitch.stop(), clientSwitch.stop()) await allFutures(serverSwitch.stop(), clientSwitch.stop())
info "check point" # log added to track flaky test