summary refs log tree commit diff stats
path: root/tests/async/t7758.nim
blob: 15aec1c042245b88c06a16a11b77cbd3c6a03316 (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 .. 4: main()