Patchwork [5,of,5] run-tests: spread and document the content of time tuple

login
register
mail settings
Submitter Pierre-Yves David
Date May 8, 2015, 6:53 p.m.
Message ID <0863fb786f918cce226e.1431111238@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/8983/
State Accepted
Headers show

Comments

Pierre-Yves David - May 8, 2015, 6:53 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1431066313 25200
#      Thu May 07 23:25:13 2015 -0700
# Node ID 0863fb786f918cce226eb1a2c0e4306a3cba79f0
# Parent  470fb04e8380ec184d9b61f4a6194aa532ef2a7a
run-tests: spread and document the content of time tuple

The spreading will make future modification clearer. The documentation improve
code readability.

Patch

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -1301,12 +1301,15 @@  class TestResult(unittest._TextTestResul
 
         test.stopped = os.times()
 
         starttime = test.started
         endtime = test.stopped
-        self.times.append((test.name, endtime[2] - starttime[2],
-                    endtime[3] - starttime[3], endtime[4] - starttime[4]))
+        self.times.append((test.name,
+                           endtime[2] - starttime[2], # user space CPU time
+                           endtime[3] - starttime[3], # sys  space CPU time
+                           endtime[4] - starttime[4], # real time
+                           ))
 
         if interrupted:
             iolock.acquire()
             self.stream.writeln('INTERRUPTED: %s (after %d seconds)' % (
                 test.name, self.times[-1][3]))