run-tests: fix some io ordering stable
authorMatt Mackall <mpm@selenic.com>
Wed, 13 Aug 2014 18:50:35 -0500
branchstable
changeset 22146 58b5196cce20
parent 22134 90c8b36d1a2e
child 22147 9ac98c2aa95c
run-tests: fix some io ordering backported from default
tests/run-tests.py
--- a/tests/run-tests.py	Wed Aug 13 14:05:08 2014 -0500
+++ b/tests/run-tests.py	Wed Aug 13 18:50:35 2014 -0500
@@ -1081,6 +1081,7 @@
     def addFailure(self, test, reason):
         self.failures.append((test, reason))
 
+        iolock.acquire()
         if self._options.first:
             self.stop()
         else:
@@ -1088,6 +1089,8 @@
                 self.stream.write('\nERROR: %s output changed\n' % test)
 
             self.stream.write('!')
+            self.stream.flush()
+        iolock.release()
 
     def addError(self, *args, **kwargs):
         super(TestResult, self).addError(*args, **kwargs)