From c08e9620d6d0fc197e5b5539149e2775d759bf48 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 15 Nov 2018 09:03:20 -0500 Subject: [PATCH] vmcheck/multitest: Time execution of each test For some reason c7 is consistently timing out, let's gather data on how long our tests take to execute. Closes: #1676 Approved by: cgwalters --- tests/vmcheck/multitest.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/vmcheck/multitest.py b/tests/vmcheck/multitest.py index ed4e6a0b..20a5538b 100755 --- a/tests/vmcheck/multitest.py +++ b/tests/vmcheck/multitest.py @@ -76,6 +76,7 @@ class Host: self.hostname = hostname self.test = "" self._p = None + self._starttime = None self.saw_fail = False def is_done(self): @@ -94,6 +95,7 @@ class Host: if not os.path.isdir("vmcheck"): os.mkdir("vmcheck") testsh = os.path.join(sys.path[0], "test.sh") + self._starttime = time.time() self._p = subprocess.Popen([testsh], env=env, stdout=open("vmcheck/%s.log" % test, 'wb'), stderr=subprocess.STDOUT) @@ -104,6 +106,7 @@ class Host: if not self._p: return 0 rc = self._p.wait() + endtime = time.time() # just merge the two files outfile = "vmcheck/{}.out".format(self.test) @@ -114,7 +117,7 @@ class Host: os.remove(outfile) rcs = "PASS" if rc == 0 else ("FAIL (rc %d)" % rc) - print("%s: %s" % (rcs, self.test)) + print("{}: {} (took {}s)".format(rcs, self.test, int(endtime - self._starttime))) self.test = "" self._p = None