summary refs log tree commit diff stats
path: root/tests/async/t12221.nim
diff options
context:
space:
mode:
authorMiran <narimiran@disroot.org>2020-03-30 13:18:12 +0200
committerGitHub <noreply@github.com>2020-03-30 13:18:12 +0200
commit8088633250872de8777c7078e636b2379780e107 (patch)
tree3ec6b06db9c970da5f9f2b80f1d7053c4021e34f /tests/async/t12221.nim
parent2a278f6eba5b154920177154bb48733268cacfc5 (diff)
downloadNim-8088633250872de8777c7078e636b2379780e107.tar.gz
faster CIs (#13803)
* ttables: smaller table, 5x speedup

* thavlak: less iterations, less loops; 30% speedup

* tasyncclosestall: shorter timeout; 35% speedup

* gcleak4: less iterations, 2x speedup

* ttimes: remove deprecated stuff

* tdangerisrelease: remove cpp backend, 3x speedup

* tfrexp1: smaller range, 2x speedup

* trtree: fix warnings, less iterations, 6x speedup

* tasyncawait_cyclebreaker: smaller swarm size; 2x speedup

* trealloc: smaller number of iterations; 10x speedup

* towned_binary_tree: less iterations, 4x speedup

* tclosure: remove unused code, less iterations; 2x speedup

* twaitany: less durations; 1.4x speedup

* tasync_misc: less iterations, 2x speedup

* t8535: smaller sleep, 1.5x speedup

* tmanyjoin: smaller sleep, 2x speedup

* t12221: shorter sleeps, removed two slower tests; 1.6x speedup

* tfuturestream: smaller sleep; 1.5x speedup

* growobjcrash: less iterations; 2x speedup

* ttryrecv: smaller sleep; 1.5x speedup

* treusetvar: less threads; 2x speedup

* delete tthreadanalysis2, basically a duplicate of tthreadanalysis

* t7758: less iterations, 1.5x speedup

* tasyncawait: smaller swarm, less messages; 1.5x speedup

* tjsandnativeasync: smaller sleep, 1.5x speedup

* tpendingcheck: smaller sleep, 1.5x speedup

* remove rodfiles test category

* move tseq from its own category to 'collections' category

* remove unneeded tests and helpers from 'assert' category

* stdlib: merge tbitops2 into tbitops

* remove 'trepr2' from 'stdlib' cat

* merge 'tstreams' into one file

* remove 'tinefficient_const_table' from 'ccbugs' cat

* merge 'tcollections_to_string' into 'tcollections'

* tblocking_channel: smaller sleep, small speedup

* tconvexhull: less iterartions; 1.2x speedup

* merge 'tdeepcopy2' into 'tdeepcopy'

* merge 'tdisjoint_slice2' into 'tdisjoint_slice1'

* tmissing_deepcopy: smaller sequence

* tsendtwice: smaller arrays; 5x speedup

* remove 'tindexerrorformatbounds'

* disable multimethod tests

* remove 'gc:none' and 'refc' without 'd:useRealtimeGC' from gc tests

* koch.nim: bootstrap just with '-d:release', no need for 'csource'

* add github workflow for documentation

* testament: no need for 8 sub-second decimals
Diffstat (limited to 'tests/async/t12221.nim')
-rw-r--r--tests/async/t12221.nim30
1 files changed, 9 insertions, 21 deletions
diff --git a/tests/async/t12221.nim b/tests/async/t12221.nim
index a6ccfb060..70e192356 100644
--- a/tests/async/t12221.nim
+++ b/tests/async/t12221.nim
@@ -1,7 +1,7 @@
 import asyncdispatch, os, times
 
 proc doubleSleep(hardSleep: int) {.async.} =
-  await sleepAsync(100)
+  await sleepAsync(50)
   sleep(hardSleep)
 
 template assertTime(target, timeTook: float): untyped {.dirty.} =
@@ -16,37 +16,25 @@ var
 
 # NOTE: this uses poll(3000) to limit timing error potential.
 start = epochTime()
-fut = sleepAsync(50) and sleepAsync(150) and doubleSleep(40)
+fut = sleepAsync(40) and sleepAsync(100) and doubleSleep(20)
 while not fut.finished:
-  poll(3000)
+  poll(1000)
 assertTime(150, epochTime() - start)
 
 start = epochTime()
-fut = sleepAsync(50) and sleepAsync(150) and doubleSleep(100)
+fut = sleepAsync(40) and sleepAsync(100) and doubleSleep(50)
 while not fut.finished:
-  poll(3000)
+  poll(1000)
 assertTime(200, epochTime() - start)
 
 start = epochTime()
-fut = sleepAsync(50) and sleepAsync(150) and doubleSleep(40) and sleepAsync(300)
+fut = sleepAsync(40) and sleepAsync(100) and doubleSleep(20) and sleepAsync(200)
 while not fut.finished:
-  poll(3000)
+  poll(1000)
 assertTime(300, epochTime() - start)
 
 start = epochTime()
-fut = sleepAsync(50) and sleepAsync(150) and doubleSleep(100) and sleepAsync(300)
+fut = (sleepAsync(40) and sleepAsync(100) and doubleSleep(20)) or sleepAsync(300)
 while not fut.finished:
-  poll(3000)
-assertTime(300, epochTime() - start)
-
-start = epochTime()
-fut = (sleepAsync(50) and sleepAsync(150) and doubleSleep(40)) or sleepAsync(700)
-while not fut.finished:
-  poll(3000)
+  poll(1000)
 assertTime(150, epochTime() - start)
-
-start = epochTime()
-fut = (sleepAsync(50) and sleepAsync(150) and doubleSleep(100)) or sleepAsync(700)
-while not fut.finished:
-  poll(3000)
-assertTime(200, epochTime() - start)