mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-06-27 20:10:02 +00:00
rename event in test
This commit is contained in:
parent
15c4e3b918
commit
47f3194dfd
@ -67,20 +67,20 @@ proc waitForConnectionStatus(
|
||||
## Completes when the node reports `expected`.
|
||||
var future = newFuture[void]("waitForConnectionStatus")
|
||||
|
||||
let handler: EventConnectionStatusChangeListenerProc = proc(
|
||||
e: EventConnectionStatusChange
|
||||
let handler: health_events.ConnectionStatusChangeEventListenerProc = proc(
|
||||
e: health_events.ConnectionStatusChangeEvent
|
||||
) {.async: (raises: []), gcsafe.} =
|
||||
if not future.finished and e.connectionStatus == expected:
|
||||
future.complete()
|
||||
|
||||
let handle = EventConnectionStatusChange.listen(brokerCtx, handler).valueOr:
|
||||
let handle = health_events.ConnectionStatusChangeEvent.listen(brokerCtx, handler).valueOr:
|
||||
raiseAssert error
|
||||
|
||||
try:
|
||||
if not await future.withTimeout(TestTimeout):
|
||||
raiseAssert "Timeout waiting for status: " & $expected
|
||||
finally:
|
||||
await EventConnectionStatusChange.dropListener(brokerCtx, handle)
|
||||
await health_events.ConnectionStatusChangeEvent.dropListener(brokerCtx, handle)
|
||||
|
||||
proc createApiNodeConf(numShards: uint16 = 1): WakuNodeConf =
|
||||
var conf = defaultWakuNodeConf().valueOr:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user