From: Tim Newsome Date: Tue, 24 Apr 2018 18:21:27 +0000 (-0700) Subject: Fix race when making logs directory X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7ba428b5d1d3c6d56a2e534daf7b3983cf3f46bf;p=riscv-tests.git Fix race when making logs directory --- diff --git a/debug/testlib.py b/debug/testlib.py index 38ae33b..0fe0322 100644 --- a/debug/testlib.py +++ b/debug/testlib.py @@ -594,8 +594,12 @@ class PrivateState(object): self.gdb.pop_state() def run_all_tests(module, target, parsed): - if not os.path.exists(parsed.logs): + try: os.makedirs(parsed.logs) + except OSError: + # There's a race where multiple instances of the test program might + # decide to create the logs directory at the same time. + pass overall_start = time.time()