Skip to contentSkip to conversation

oeqa/core/context: initialize _run_end_time

PATCH New Konrad Weihmann 1 participant 2 messages Nov 10, 2020 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 2/3 oeqa/core/context: initialize _run_end_time

with _run_start_time as value. For partial results of interrupted runs, this info might be otherwise missing for at least one testcase

---
 meta/lib/oeqa/core/context.py | 1 +
 1 file changed, 1 insertion(+)
meta/lib/oeqa/core/context.py +1 -0
index 84b43a93e1..2abe353d27 100644
@@ -85,6 +85,7 @@ class OETestContext(object):
         self.skipTests(skips)
 
         self._run_start_time = time.time()
+        self._run_end_time = self._run_start_time
         if not processes:
             self.runner.buffer = True
         result = self.runner.run(self.prepareSuite(self.suites, processes))
Signature · 1 line
2.25.1
#2 lore raw

PATCH 3/3 testimage: print results for interrupted runs

In reply to a message not in the archive

When a run is ended by overall timeout, print the already executed testcases, to provide some hints which testcase might made the test suite reach global timeout.
Nonetheless make the testrun exit with an error

---
 meta/classes/testimage.bbclass | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)
meta/classes/testimage.bbclass +11 -8
index e3feef02f8..78da4b09bd 100644
@@ -367,6 +367,7 @@ def testimage_main(d):
     package_extraction(d, tc.suites)
 
     results = None
+    complete = False
     orig_sigterm_handler = signal.signal(signal.SIGTERM, sigterm_exception)
     try:
         # We need to check if runqemu ends unexpectedly
@@ -378,6 +379,7 @@ def testimage_main(d):
         except ValueError:
             pass
         results = tc.runTests()
+        complete = True
     except (KeyboardInterrupt, BlockingIOError) as err:
         if isinstance(err, KeyboardInterrupt):
             bb.error('testimage interrupted, shutting down...')
@@ -385,20 +387,21 @@ def testimage_main(d):
             bb.error('runqemu failed, shutting down...')
         if results:
             results.stop()
-            results = None
+        results = tc.results
     finally:
         signal.signal(signal.SIGTERM, orig_sigterm_handler)
         tc.target.stop()
 
     # Show results (if we have them)
-    if not results:
+    if results:
+        configuration = get_testimage_configuration(d, 'runtime', machine)
+        results.logDetails(get_testimage_json_result_dir(d),
+                        configuration,
+                        get_testimage_result_id(configuration),
+                        dump_streams=d.getVar('TESTREPORT_FULLLOGS'))
+        results.logSummary(pn)
+    if not results or not complete:
         bb.fatal('%s - FAILED - tests were interrupted during execution' % pn, forcelog=True)
-    configuration = get_testimage_configuration(d, 'runtime', machine)
-    results.logDetails(get_testimage_json_result_dir(d),
-                       configuration,
-                       get_testimage_result_id(configuration),
-                       dump_streams=d.getVar('TESTREPORT_FULLLOGS'))
-    results.logSummary(pn)
     if not results.wasSuccessful():
         bb.fatal('%s - FAILED - check the task log and the ssh log' % pn, forcelog=True)
 
Signature · 1 line
2.25.1