diff options
author | Don Anderson <dda@mongodb.com> | 2016-12-19 00:43:52 -0500 |
---|---|---|
committer | David Hows <howsdav@gmail.com> | 2016-12-19 16:43:52 +1100 |
commit | 3c0c55340f577b847990247dfc47063930b5c50b (patch) | |
tree | 98af768ccab39e4cfa05d9667e845c462d4a6d4b | |
parent | 8ae0338420c8902bdaf323f66ff09d44d4e6eb0c (diff) | |
download | mongo-3c0c55340f577b847990247dfc47063930b5c50b.tar.gz |
WT-3080 Python test suite: add elapsed time for tests (#3201)
For tests that are non-trivial (> 0.001 seconds) show the elapsed time if our verboseness is high enough. This will increase the amount of console output.
-rw-r--r-- | test/suite/wttest.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/suite/wttest.py b/test/suite/wttest.py index 4d6df0bc8bd..bd6d2005cd9 100644 --- a/test/suite/wttest.py +++ b/test/suite/wttest.py @@ -287,6 +287,7 @@ class WiredTigerTestCase(unittest.TestCase): self.testsubdir = self.className() + '.' + str(self.__class__.wt_ntests) self.testdir = os.path.join(WiredTigerTestCase._parentTestdir, self.testsubdir) self.__class__.wt_ntests += 1 + self.starttime = time.time() if WiredTigerTestCase._verbose > 2: self.prhead('started in ' + self.testdir, True) # tearDown needs connections list, set it here in case the open fails. @@ -355,6 +356,9 @@ class WiredTigerTestCase(unittest.TestCase): else: self.pr('preserving directory ' + self.testdir) + elapsed = time.time() - self.starttime + if elapsed > 0.001 and WiredTigerTestCase._verbose >= 2: + print "%s: %.2f seconds" % (str(self), elapsed) if not passed and not skipped: print "ERROR in " + str(self) self.pr('FAIL') |