[PATCH 1 of 4] run-tests: ignore failed removal of nonexistent installerrs

Augie Fackler raf at durin42.com
Thu Aug 27 21:22:00 UTC 2015


# HG changeset patch
# User Augie Fackler <augie at google.com>
# Date 1440477642 14400
#      Tue Aug 25 00:40:42 2015 -0400
# Node ID a95e83c37395eaf43d9584f50228c94fec3d084d
# Parent  3670efdc70885ea0d1eaec101d598416d95490e2
run-tests: ignore failed removal of nonexistent installerrs

When running tests with -j100 or so on a large machine, I see this
os.remove call failing semi-regularly. Since it's not really a problem
when the file is already gone, just suppress the error in that case.

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -2078,7 +2078,11 @@ class TestRunner(object):
         vlog("# Running", cmd)
         if os.system(cmd) == 0:
             if not self.options.verbose:
-                os.remove(installerrs)
+                try:
+                    os.remove(installerrs)
+                except OSError as e:
+                    if e.errno != errno.ENOENT:
+                        raise
         else:
             f = open(installerrs, 'rb')
             for line in f:


More information about the Mercurial-devel mailing list