summary refs log tree commit diff stats
path: root/tests/async
diff options
context:
space:
mode:
authorDominik Picheta <dominikpicheta@googlemail.com>2018-08-25 08:44:02 +0100
committerAndreas Rumpf <rumpf_a@web.de>2018-08-25 09:44:02 +0200
commit81f920a4ee0c234b953d34ab7d7e8db891638f3f (patch)
treef08735a36d61b010ec8260c264c01c1c61822fb7 /tests/async
parent6f13184e40b21956f53e407888ac2730a5e5e58c (diff)
downloadNim-81f920a4ee0c234b953d34ab7d7e8db891638f3f.tar.gz
Process timers before and after `select`. Fixes flaky #7758 test. (#8750)
Diffstat (limited to 'tests/async')
-rw-r--r--tests/async/t7758.nim11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/async/t7758.nim b/tests/async/t7758.nim
index 6ae98679d..102a4ce4c 100644
--- a/tests/async/t7758.nim
+++ b/tests/async/t7758.nim
@@ -1,18 +1,19 @@
 discard """
   file: "t7758.nim"
   exitcode: 0
-  disabled: true
 """
 import asyncdispatch
 
 proc task() {.async.} =
-  await sleepAsync(1000)
+  await sleepAsync(40)
 
-when isMainModule:
+proc main() =
   var counter = 0
   var f = task()
   while not f.finished:
     inc(counter)
-    poll()
+    poll(10)
 
-doAssert counter == 2
\ No newline at end of file
+  doAssert counter <= 4
+
+for i in 0 .. 10: main()
\ No newline at end of file