diff options
author | Paul Vinciguerra <pvinci@vinciconsulting.com> | 2019-12-04 19:43:53 -0500 |
---|---|---|
committer | Dave Wallace <dwallacelf@gmail.com> | 2020-01-14 19:33:23 +0000 |
commit | 48bdbcd8f9d573138c43f994ddfff946d8a9d9b5 (patch) | |
tree | 51bd7c72590aca03069b4c799535500d193b9877 /test/framework.py | |
parent | 57584d99dd8a8524db90c67c88525d58879d9b8e (diff) |
tests: fix worker thread initialization
from threading.thread __init__:
This constructor should always be called with keyword arguments.
If a subclass overrides the constructor, it must make sure to invoke
the base class constructor (Thread.__init__()) before doing anything
else to the thread.
Type: test
Change-Id: Ifa89202e97053a4baf19e9a0ca0913430d5087a3
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'test/framework.py')
-rw-r--r-- | test/framework.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/framework.py b/test/framework.py index e08c9a1145c..ba4576518b9 100644 --- a/test/framework.py +++ b/test/framework.py @@ -1496,16 +1496,17 @@ class VppTestRunner(unittest.TextTestRunner): class Worker(Thread): - def __init__(self, args, logger, env=None): + def __init__(self, executable_args, logger, env=None, *args, **kwargs): + super(Worker, self).__init__(*args, **kwargs) self.logger = logger - self.args = args + self.args = executable_args if hasattr(self, 'testcase') and self.testcase.debug_all: if self.testcase.debug_gdbserver: self.args = ['/usr/bin/gdbserver', 'localhost:{port}' .format(port=self.testcase.gdbserver_port)] + args elif self.testcase.debug_gdb and hasattr(self, 'wait_for_gdb'): self.args.append(self.wait_for_gdb) - self.app_bin = args[0] + self.app_bin = executable_args[0] self.app_name = os.path.basename(self.app_bin) if hasattr(self, 'role'): self.app_name += ' {role}'.format(role=self.role) @@ -1513,7 +1514,6 @@ class Worker(Thread): self.result = None env = {} if env is None else env self.env = copy.deepcopy(env) - super(Worker, self).__init__() def wait_for_enter(self): if not hasattr(self, 'testcase'): |