Index: packages/Python/lldbsuite/test/lldbtest.py =================================================================== --- packages/Python/lldbsuite/test/lldbtest.py +++ packages/Python/lldbsuite/test/lldbtest.py @@ -1820,7 +1820,14 @@ # destination first if it already exists. os.remove(dst) - os.rename(src, dst) + try: + os.rename(src, dst) + except: + # We've seen consistent rename failures on Windows, perhaps because the + # just-created log file is being scanned by anti-virus. Empirically, this + # sleep-and-retry approach allows tests to succeed much more reliably. + time.sleep(0.5) + os.rename(src, dst) else: # success! (and we don't want log files) delete log files for log_file in log_files_for_this_test: