summary refs log tree commit diff stats
path: root/tests/async/t7758.nim
blob: ce4df1fc929734983d4cc8ab7a52f72d31f02f7a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import asyncdispatch

proc task() {.async.} =
  await sleepAsync(40)

proc main() =
  var counter = 0
  var f = task()
  while not f.finished:
    inc(counter)
    poll(10)

  doAssert counter <= 4

for i in 0 .. 10: main()