Skip to content

Commit ab2f348

Browse files
committed
Insert sleep in test. Too fast in -d:release.
1 parent 664867b commit ab2f348

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

test/subscribe.nim

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,18 @@ suite "test suite for subscribe":
5151
let (tpc, msg) = tdata("subscribe to topic qos=2")
5252

5353
proc conn() {.async.} =
54+
# We need all these sleepAsync cause it's too fast in -d:release
55+
await sleepAsync 500
5456
proc on_data_sub_qos2(topic: string, message: string) =
5557
if topic == tpc:
5658
check(message == msg)
5759
return
5860
await ctxListen.subscribe(tpc, 2, on_data_sub_qos2)
59-
await sleepAsync 500
61+
await sleepAsync 1000
6062
await ctxMain.publish(tpc, msg, 2)
61-
await sleepAsync 500
63+
await sleepAsync 1000
6264
await ctxListen.unsubscribe(tpc)
63-
await sleepAsync 500
65+
await sleepAsync 1000
6466
check(testDmp[0][0] == "tx> Subscribe(02):")
6567
check(testDmp[1][0] == "rx> SubAck(00):") # and testDmp[1][1] == "00 03 02 ") # and testDmp[1][1] == "00 01 02 ")
6668
check(testDmp[2][0] == "tx> Publish(04):")

0 commit comments

Comments
 (0)