Bug 1176028 - Use the jstest's task generator directly; r=sfink
authorTerrence Cole <terrence@mozilla.com>
Thu, 18 Jun 2015 11:42:21 -0700
changeset 280670 88f5bdaf1d8e96022f5bee0f4dbd368f5b42305a
parent 280669 43aa1645ee307aa63c414487e708e3a0d3e68e5f
child 280671 23684898a4573df56b05b5099b2de450eed2c44b
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-beta@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1176028
milestone41.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1176028 - Use the jstest's task generator directly; r=sfink
js/src/tests/jstests.py
js/src/tests/lib/tasks_unix.py
js/src/tests/lib/tasks_win.py
--- a/js/src/tests/jstests.py
+++ b/js/src/tests/jstests.py
@@ -363,19 +363,20 @@ def main():
         os.environ['TZ'] = 'PST8PDT'
         # Force date strings to English.
         os.environ['LC_TIME'] = 'en_US.UTF-8'
 
         results = ResultsSink(options, len(skip_list) + len(test_list))
         try:
             for t in skip_list:
                 results.push(NullTestOutput(t))
-            ok = run_all_tests(test_list, prefix, results, options)
+            for out in run_all_tests(test_list, prefix, results, options):
+                results.push(out)
+            results.finish(True)
         except KeyboardInterrupt:
-            ok = False
+            results.finish(False)
 
-        results.finish(ok)
         return 0 if results.all_passed() else 1
 
     return 0
 
 if __name__ == '__main__':
     sys.exit(main())
--- a/js/src/tests/lib/tasks_unix.py
+++ b/js/src/tests/lib/tasks_unix.py
@@ -177,17 +177,17 @@ def reap_zombies(tasks, timeout):
 def kill_undead(tasks, timeout):
     """
     Signal all children that are over the given timeout.
     """
     for task in tasks:
         if timed_out(task, timeout):
             os.kill(task.pid, 9)
 
-def run_all_tests_gen(tests, prefix, results, options):
+def run_all_tests(tests, prefix, results, options):
     # Copy and reverse for fast pop off end.
     tests = tests[:]
     tests.reverse()
 
     # The set of currently running tests.
     tasks = []
 
     while len(tests) or len(tasks):
@@ -198,17 +198,8 @@ def run_all_tests_gen(tests, prefix, res
         read_input(tasks, timeout)
 
         kill_undead(tasks, options.timeout)
         tasks, finished = reap_zombies(tasks, options.timeout)
 
         # With Python3.4+ we could use yield from to remove this loop.
         for out in finished:
             yield out
-
-    return True
-
-def run_all_tests(tests, prefix, results, options):
-    for out in run_all_tests_gen(tests, prefix, results, options):
-        results.push(out)
-    results.pb.poke()
-
-
--- a/js/src/tests/lib/tasks_win.py
+++ b/js/src/tests/lib/tasks_win.py
@@ -59,17 +59,17 @@ def _do_watch(qWatch, timeout):
             assert fin is TaskFinishedMarker, "invalid finish marker"
         except Empty:
             # Timed out, force-kill the test.
             proc.terminate()
             fin = qWatch.get(block=True, timeout=sys.maxint)
             assert fin is TaskFinishedMarker, "invalid finish marker"
 
 
-def run_all_tests_gen(tests, prefix, results, options):
+def run_all_tests(tests, prefix, results, options):
     """
     Uses scatter-gather to a thread-pool to manage children.
     """
     qTasks, qResults = Queue(), Queue()
 
     workers = []
     watchdogs = []
     for _ in range(options.worker_count):
@@ -109,15 +109,8 @@ def run_all_tests_gen(tests, prefix, res
 
     # Cleanup and exit.
     for worker in workers:
         worker.join()
     for watcher in watchdogs:
         watcher.join()
     assert qTasks.empty(), "Send queue not drained"
     assert qResults.empty(), "Result queue not drained"
-
-
-def run_all_tests(tests, prefix, results, options):
-    for result in run_all_tests_gen(tests, prefix, results, options):
-        results.push(result)
-    return True
-