Mailing List Archive

[6850] cherokee/trunk/qa/run-tests.py: Increases the delay of the thread launching mechanism according to the
Revision: 6850
http://svn.cherokee-project.com/changeset/6850
Author: alo
Date: 2011-09-15 00:19:31 +0200 (Thu, 15 Sep 2011)
Log Message:
-----------
Increases the delay of the thread launching mechanism according to the
number of tests being run.

Modified Paths:
--------------
cherokee/trunk/qa/run-tests.py

Modified: cherokee/trunk/qa/run-tests.py
===================================================================
--- cherokee/trunk/qa/run-tests.py 2011-09-14 22:19:27 UTC (rev 6849)
+++ cherokee/trunk/qa/run-tests.py 2011-09-14 22:19:31 UTC (rev 6850)
@@ -422,7 +422,7 @@
sys.stdin.readline()
pause = pause - 1

-def mainloop_iterator(objs, main_thread=True):
+def mainloop_iterator (objs, main_thread=True):
global port
global pause
global its_clean
@@ -499,11 +499,16 @@

# Maybe launch some threads
for n in range(thds-1):
- time.sleep (random.randint(0,50) / 100.0)
- thread.start_new_thread (mainloop_iterator, (copy.deepcopy(objs), False))
+ # Delay launch a little
+ delay = ((random.randint(0,50) + len(objs)) / 100.0)
+ time.sleep (delay)

+ # Launch the thread
+ objs_copy = copy.deepcopy(objs)
+ thread.start_new_thread (mainloop_iterator, (objs_copy, False))
+
# Execute the tests
mainloop_iterator(objs)

-# It's time to kill Cherokee.. :-(
+# We're done. Kill the server.
clean_up()