run-tests: stop storing start/stop times in a dict by test name
This resolves the last breakage in run-tests that prevented me from
running a single test many times in several threads in parallel. This
will be useful for testing potential fixes to flaky tests.
--- a/tests/run-tests.py Fri Mar 13 12:47:16 2015 -0400
+++ b/tests/run-tests.py Fri Mar 13 12:50:53 2015 -0400
@@ -1142,8 +1142,6 @@
self.warned = []
self.times = []
- self._started = {}
- self._stopped = {}
# Data stored for the benefit of generating xunit reports.
self.successes = []
self.faildata = {}
@@ -1265,21 +1263,18 @@
# child's processes along with real elapsed time taken by a process.
# This module has one limitation. It can only work for Linux user
# and not for Windows.
- self._started[test.name] = os.times()
+ test.started = os.times()
def stopTest(self, test, interrupted=False):
super(TestResult, self).stopTest(test)
- self._stopped[test.name] = os.times()
+ test.stopped = os.times()
- starttime = self._started[test.name]
- endtime = self._stopped[test.name]
+ starttime = test.started
+ endtime = test.stopped
self.times.append((test.name, endtime[2] - starttime[2],
endtime[3] - starttime[3], endtime[4] - starttime[4]))
- del self._started[test.name]
- del self._stopped[test.name]
-
if interrupted:
iolock.acquire()
self.stream.writeln('INTERRUPTED: %s (after %d seconds)' % (