sanitycheck: show which threads are stuck

Print a warning if some threads are taking more time and seem to be
stuck.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2020-01-29 22:17:47 -05:00 committed by Carles Cufí
commit 923ca14b7d

View file

@ -2905,7 +2905,7 @@ class TestSuite:
while future_to_test:
# check for status of the futures which are currently working
done, _ = concurrent.futures.wait(future_to_test, timeout=1,
done, pending = concurrent.futures.wait(future_to_test, timeout=1,
return_when=concurrent.futures.FIRST_COMPLETED)
# if there is incoming work, start a new future
@ -2944,6 +2944,18 @@ class TestSuite:
# remove the now completed future
del future_to_test[future]
for future in pending:
test = future_to_test[future]
try:
future.result(timeout=180)
except concurrent.futures.TimeoutError:
logger.warning("{} stuck?".format(test))
if self.enable_size_report and not self.cmake_only:
# Parallelize size calculation
executor = concurrent.futures.ThreadPoolExecutor(self.jobs)