[tor-commits] [stem/master] Reduce priority of background tests
atagar at torproject.org
atagar at torproject.org
Thu Jun 8 17:17:55 UTC 2017
commit b7dc0a8f02f5cb366aa80438678b4245d001481f
Author: Damian Johnson <atagar at torproject.org>
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()
More information about the tor-commits
mailing list