projects
/
python_utils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7641e2a
)
Take a lock before reading cross thread.
author
Scott Gasch
<
[email protected]
>
Sat, 4 Jun 2022 00:12:38 +0000
(17:12 -0700)
committer
Scott Gasch
<
[email protected]
>
Sat, 4 Jun 2022 00:12:38 +0000
(17:12 -0700)
tests/run_tests.py
patch
|
blob
|
history
diff --git
a/tests/run_tests.py
b/tests/run_tests.py
index c96f882bb3d76306a2932aeb01d047b177fea456..3e5ee07758651b29f3187bdfdb7c1fbe4d14e475 100755
(executable)
--- a/
tests/run_tests.py
+++ b/
tests/run_tests.py
@@
-141,6
+141,7
@@
class TestRunner(ABC, thread_utils.ThreadWithReturnValue):
tests_timed_out=[],
)
self.tests_started = 0
+ self.lock = threading.Lock()
@abstractmethod
def get_name(self) -> str:
@@
-149,7
+150,8
@@
class TestRunner(ABC, thread_utils.ThreadWithReturnValue):
def get_status(self) -> Tuple[int, TestResults]:
"""Ask the TestRunner for its status."""
- return (self.tests_started, self.test_results)
+ with self.lock:
+ return (self.tests_started, self.test_results)
@abstractmethod
def begin(self, params: TestingParameters) -> TestResults: