summary refs log tree commit diff stats
path: root/tests/async/t7758.nim
blob: 102a4ce4c0f6d933e6fe9dc3510d8e44de36930d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
discard """
  file: "t7758.nim"
  exitcode: 0
"""
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()