mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-06 20:04:18 +00:00
try to fix the flaky test, similarly to the devel version
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import asyncdispatch
|
||||
|
||||
proc task() {.async.} =
|
||||
await sleepAsync(40)
|
||||
const tSleep = 40
|
||||
await sleepAsync(tSleep)
|
||||
|
||||
proc main() =
|
||||
var counter = 0
|
||||
@@ -10,6 +11,10 @@ proc main() =
|
||||
inc(counter)
|
||||
poll(10)
|
||||
|
||||
doAssert counter <= 4
|
||||
const slack = 1
|
||||
# because there is overhead in `async` + `sleepAsync`
|
||||
# as can be seen by increasing `tSleep` from 40 to 49, which increases the number
|
||||
# of failures.
|
||||
doAssert counter <= 4 + slack
|
||||
|
||||
for i in 0 .. 4: main()
|
||||
|
||||
Reference in New Issue
Block a user