[yt-svn] commit/yt: 3 new changesets

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Mon Mar 27 09:11:58 PDT 2017


3 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/0aecfa7e574b/
Changeset:   0aecfa7e574b
Branch:      yt
User:        xarthisius
Date:        2017-03-25 17:04:36+00:00
Summary:     Ensure that the cookbook and unittests are run in separate threads
Affected #:  1 file

diff -r 7a9c1db6eb09295e159e63c996c1a4399effa480 -r 0aecfa7e574bf3fbdc78f07ce39451ba5e11fbe8 tests/nose_runner.py
--- a/tests/nose_runner.py
+++ b/tests/nose_runner.py
@@ -28,12 +28,17 @@
             result = next_task()
             self.task_queue.task_done()
             self.result_queue.put(result)
+            if next_task.exclusive:
+                print("%s: Exiting (exclusive)" % proc_name)
+                break
         return
 
 class NoseTask(object):
-    def __init__(self, argv):
+    def __init__(self, job):
+        argv, exclusive = job
         self.argv = argv
         self.name = argv[0]
+        self.exclusive = exclusive
 
     def __call__(self):
         old_stderr = sys.stderr
@@ -69,12 +74,12 @@
                       if DROP_TAG not in line])
     tests = yaml.load(data)
 
-    base_argv = ['--local-dir=%s' % answers_dir,
+    base_argv = ['--local-dir=%s' % answers_dir, '-s', '--nologcapture',
                  '--with-answer-testing', '--answer-big-data', '--local']
     args = []
 
     for test in list(tests["other_tests"].keys()):
-        args.append([test] + tests["other_tests"][test])
+        args.append(([test] + tests["other_tests"][test], True))
     for answer in list(tests["answer_tests"].keys()):
         if tests["answer_tests"][answer] is None:
             continue
@@ -82,10 +87,10 @@
         argv += base_argv
         argv.append('--answer-name=%s' % argv[0])
         argv += tests["answer_tests"][answer]
-        args.append(argv)
+        args.append((argv, False))
 
-    args = [item + ['-s', '--nologcapture', '--xunit-file=%s.xml' % item[0]]
-            for item in args]
+    args = [(item + ['--xunit-file=%s.xml' % item[0]], exclusive)
+            for item, exclusive in args]
     return args
 
 if __name__ == "__main__":
@@ -100,6 +105,8 @@
 
     num_jobs = 0
     for job in generate_tasks_input():
+        if job[1]:
+            num_consumers -= 1  # take into account exclusive jobs
         tasks.put(NoseTask(job))
         num_jobs += 1
 
@@ -110,5 +117,4 @@
 
     while num_jobs:
         result = results.get()
-        print(result)
         num_jobs -= 1


https://bitbucket.org/yt_analysis/yt/commits/0552d84f28c7/
Changeset:   0552d84f28c7
Branch:      yt
User:        xarthisius
Date:        2017-03-25 21:19:01+00:00
Summary:     Allow to configure the number of workers during runtime
Affected #:  1 file

diff -r 0aecfa7e574bf3fbdc78f07ce39451ba5e11fbe8 -r 0552d84f28c7e090a32eae024b7a499d69857e84 tests/nose_runner.py
--- a/tests/nose_runner.py
+++ b/tests/nose_runner.py
@@ -98,7 +98,7 @@
     tasks = multiprocessing.JoinableQueue()
     results = multiprocessing.Queue()
 
-    num_consumers = 6  # TODO 
+    num_consumers = os.environ.get('NUM_WORKERS', 6)
     consumers = [NoseWorker(tasks, results) for i in range(num_consumers)]
     for w in consumers:
         w.start()


https://bitbucket.org/yt_analysis/yt/commits/89085b642161/
Changeset:   89085b642161
Branch:      yt
User:        xarthisius
Date:        2017-03-25 21:32:29+00:00
Summary:     num_consumers needs to be an int
Affected #:  1 file

diff -r 0552d84f28c7e090a32eae024b7a499d69857e84 -r 89085b6421618adde7a4d1fbc07a88906ba5775f tests/nose_runner.py
--- a/tests/nose_runner.py
+++ b/tests/nose_runner.py
@@ -98,7 +98,7 @@
     tasks = multiprocessing.JoinableQueue()
     results = multiprocessing.Queue()
 
-    num_consumers = os.environ.get('NUM_WORKERS', 6)
+    num_consumers = int(os.environ.get('NUM_WORKERS', 6))
     consumers = [NoseWorker(tasks, results) for i in range(num_consumers)]
     for w in consumers:
         w.start()

Repository URL: https://bitbucket.org/yt_analysis/yt/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.



More information about the yt-svn mailing list