graphics_dEQP: Add start/end times to debug logs
Some dEQP tests can leave the system in a state that causes
subsequent tests to fail. Adding start/end times to the
per-test debug logs can help determine the order tests were
run and which test may have caused other tests to fail.
BUG=None.
TEST=Run graphics_dEQP.py with the debug option and observe
start and end times in the debug logs.
Change-Id: Ie73145b6058f53d85631c5834a416ea82d3e03d7
Signed-off-by: Mike Mason <michael.w.mason@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/350398
Commit-Ready: Ilja H. Friedel <ihf@chromium.org>
Tested-by: Ilja H. Friedel <ihf@chromium.org>
Reviewed-by: Ilja H. Friedel <ihf@chromium.org>
diff --git a/client/site_tests/graphics_dEQP/graphics_dEQP.py b/client/site_tests/graphics_dEQP/graphics_dEQP.py
index 13caf42..50e5c82 100644
--- a/client/site_tests/graphics_dEQP/graphics_dEQP.py
+++ b/client/site_tests/graphics_dEQP/graphics_dEQP.py
@@ -10,6 +10,7 @@
import re
import shutil
import tempfile
+import time
import xml.etree.ElementTree as et
from autotest_lib.client.bin import test, utils
from autotest_lib.client.common_lib import error
@@ -313,6 +314,7 @@
# Must initialize because some errors don't repopulate
# run_result, leaving old results.
run_result = {}
+ start_time = time.time()
try:
run_result = utils.run(command,
timeout=self._timeout,
@@ -331,10 +333,13 @@
result = 'CommandFailed'
except Exception:
result = 'UnexpectedError'
+ end_time = time.time()
if self._debug:
# Collect debug info and save to json file.
- output_msgs = {'stdout': [], 'stderr': [], 'dmesg': []}
+ output_msgs = {'start_time': start_time,
+ 'end_time': end_time,
+ 'stdout': [], 'stderr': [], 'dmesg': []}
logs = self._log_reader.get_logs()
self._log_reader.set_start_by_current()
output_msgs['dmesg'] = [msg