[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [stem/master] Reduce priority of background tests



commit b7dc0a8f02f5cb366aa80438678b4245d001481f
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Tue Jun 6 10:14:36 2017 -0700

    Reduce priority of background tests
    
    Dropping the niceness priority of our background tests so they don't compete
    with our main testing thread so much. Not a lot, but drops the runtime for me
    from 27.5s to 26.4s (4% faster).
---
 stem/util/test_tools.py | 2 ++
 test/task.py            | 1 +
 2 files changed, 3 insertions(+)

diff --git a/stem/util/test_tools.py b/stem/util/test_tools.py
index 43befd4..9f4fff4 100644
--- a/stem/util/test_tools.py
+++ b/stem/util/test_tools.py
@@ -110,6 +110,8 @@ class AsyncTest(object):
 
   def run(self, *runner_args, **kwargs):
     def _wrapper(conn, runner, args):
+      os.nice(12)
+
       try:
         runner(*args) if args else runner()
         conn.send(AsyncResult('success', None))
diff --git a/test/task.py b/test/task.py
index 63a9f20..c647736 100644
--- a/test/task.py
+++ b/test/task.py
@@ -170,6 +170,7 @@ class Task(object):
     try:
       if self._is_background_task:
         def _run_wrapper(conn, runner, args):
+          os.nice(15)
           conn.send(runner(*args) if args else runner())
           conn.close()
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits