mirror of https://github.com/waku-org/nwaku.git
fix: improve filter test race condition (#1529)
* fix: improve filter test race condition * fix: missed one sleep
This commit is contained in:
parent
94459b4886
commit
f36d708e76
|
@ -69,11 +69,11 @@ suite "Waku Filter":
|
|||
require (await client.subscribe(pubsubTopic, contentTopic, pushHandler, peer=serverAddr)).isOk()
|
||||
|
||||
# WARN: Sleep necessary to avoid a race condition between the subscription and the handle message proc
|
||||
await sleepAsync(5.milliseconds)
|
||||
await sleepAsync(500.milliseconds)
|
||||
|
||||
await server.handleMessage(pubsubTopic, msg)
|
||||
|
||||
require await pushHandlerFuture.withTimeout(5.seconds)
|
||||
require await pushHandlerFuture.withTimeout(3.seconds)
|
||||
|
||||
## Then
|
||||
let (pushedMsgPubsubTopic, pushedMsg) = pushHandlerFuture.read()
|
||||
|
@ -112,7 +112,7 @@ suite "Waku Filter":
|
|||
require (await client.subscribe(pubsubTopic, contentTopic, pushHandler, peer=serverAddr)).isOk()
|
||||
|
||||
# WARN: Sleep necessary to avoid a race condition between the subscription and the handle message proc
|
||||
await sleepAsync(5.milliseconds)
|
||||
await sleepAsync(500.milliseconds)
|
||||
|
||||
await server.handleMessage(pubsubTopic, msg)
|
||||
|
||||
|
@ -124,7 +124,7 @@ suite "Waku Filter":
|
|||
require (await client.unsubscribe(pubsubTopic, contentTopic, peer=serverAddr)).isOk()
|
||||
|
||||
# WARN: Sleep necessary to avoid a race condition between the unsubscription and the handle message proc
|
||||
await sleepAsync(5.milliseconds)
|
||||
await sleepAsync(500.milliseconds)
|
||||
|
||||
await server.handleMessage(pubsubTopic, msg)
|
||||
|
||||
|
@ -164,7 +164,7 @@ suite "Waku Filter":
|
|||
require (await client.subscribe(pubsubTopic, contentTopic, pushHandler, peer=serverAddr)).isOk()
|
||||
|
||||
# WARN: Sleep necessary to avoid a race condition between the unsubscription and the handle message proc
|
||||
await sleepAsync(5.milliseconds)
|
||||
await sleepAsync(500.milliseconds)
|
||||
|
||||
await server.handleMessage(DefaultPubsubTopic, msg)
|
||||
|
||||
|
@ -174,7 +174,7 @@ suite "Waku Filter":
|
|||
# Stop client node to test timeout unsubscription
|
||||
await clientSwitch.stop()
|
||||
|
||||
await sleepAsync(5.milliseconds)
|
||||
await sleepAsync(500.milliseconds)
|
||||
|
||||
# First failure should not remove the subscription
|
||||
await server.handleMessage(DefaultPubsubTopic, msg)
|
||||
|
@ -229,7 +229,7 @@ suite "Waku Filter":
|
|||
require (await client.subscribe(pubsubTopic, contentTopic, pushHandler, peer=serverAddr)).isOk()
|
||||
|
||||
# WARN: Sleep necessary to avoid a race condition between the unsubscription and the handle message proc
|
||||
await sleepAsync(5.milliseconds)
|
||||
await sleepAsync(500.milliseconds)
|
||||
|
||||
await server.handleMessage(DefaultPubsubTopic, msg)
|
||||
|
||||
|
@ -243,7 +243,7 @@ suite "Waku Filter":
|
|||
# Stop switch to test unsubscribe
|
||||
await clientSwitch.stop()
|
||||
|
||||
await sleepAsync(5.milliseconds)
|
||||
await sleepAsync(500.milliseconds)
|
||||
|
||||
# First failure should add to failure list
|
||||
await server.handleMessage(DefaultPubsubTopic, msg)
|
||||
|
|
Loading…
Reference in New Issue