Currently exceptions from tests that are not explicitly handled are lost
due to the way Python's multiprocessing module works. This means that
programming errors in the runner are silently ignore with the test not
being run or counted.
Instead, log the traceback for any unexpected exception and terminate
the runner, as this is programming error in the runner and should always
be fatal.
import filecmp
import subprocess
import yaml
+import traceback
VALIDATE_EVE = False
WIN32 = sys.platform == "win32"
check_args_fail()
with lock:
count_dict["failed"] += 1
+ except Exception as err:
+ print("===> {}: FAILED: Unexpected exception: {}".format(os.path.basename(dirpath), err))
+ traceback.print_exc()
+
+ # Always terminate the runner on this type of error, as its an error in the framework.
+ with lock:
+ check_args['fail'] = 1
+ count_dict["failed"] += 1
+ raise TerminatePoolError()
def run_mp(jobs, tests, dirpath, args, cwd, suricata_config):
print("Number of concurrent jobs: %d" % jobs)