summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonrad Weihmann <kweihmann@outlook.com>2020-11-10 20:20:16 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-11-20 10:53:21 +0000
commit010625f35a5f879859d149c747f721abeae42627 (patch)
tree5247f74d07196b16d63a07b72d87d7042ae65a3d
parent0647439a0a02d8a433ae9d262b98b66d76888b7b (diff)
downloadpoky-010625f35a5f879859d149c747f721abeae42627.tar.gz
testimage: print results for interrupted runs
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 (From OE-Core rev: 54a7e5feee2bec78f8d526b69076fd0e8e50e228) Signed-off-by: Konrad Weihmann <kweihmann@outlook.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 2bcc643195a3b3c66d698fac8b7af037c08545ac) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/testimage.bbclass19
1 files changed, 11 insertions, 8 deletions
diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index e3feef02f8..78da4b09bd 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -367,6 +367,7 @@ def testimage_main(d):
367 package_extraction(d, tc.suites) 367 package_extraction(d, tc.suites)
368 368
369 results = None 369 results = None
370 complete = False
370 orig_sigterm_handler = signal.signal(signal.SIGTERM, sigterm_exception) 371 orig_sigterm_handler = signal.signal(signal.SIGTERM, sigterm_exception)
371 try: 372 try:
372 # We need to check if runqemu ends unexpectedly 373 # We need to check if runqemu ends unexpectedly
@@ -378,6 +379,7 @@ def testimage_main(d):
378 except ValueError: 379 except ValueError:
379 pass 380 pass
380 results = tc.runTests() 381 results = tc.runTests()
382 complete = True
381 except (KeyboardInterrupt, BlockingIOError) as err: 383 except (KeyboardInterrupt, BlockingIOError) as err:
382 if isinstance(err, KeyboardInterrupt): 384 if isinstance(err, KeyboardInterrupt):
383 bb.error('testimage interrupted, shutting down...') 385 bb.error('testimage interrupted, shutting down...')
@@ -385,20 +387,21 @@ def testimage_main(d):
385 bb.error('runqemu failed, shutting down...') 387 bb.error('runqemu failed, shutting down...')
386 if results: 388 if results:
387 results.stop() 389 results.stop()
388 results = None 390 results = tc.results
389 finally: 391 finally:
390 signal.signal(signal.SIGTERM, orig_sigterm_handler) 392 signal.signal(signal.SIGTERM, orig_sigterm_handler)
391 tc.target.stop() 393 tc.target.stop()
392 394
393 # Show results (if we have them) 395 # Show results (if we have them)
394 if not results: 396 if results:
397 configuration = get_testimage_configuration(d, 'runtime', machine)
398 results.logDetails(get_testimage_json_result_dir(d),
399 configuration,
400 get_testimage_result_id(configuration),
401 dump_streams=d.getVar('TESTREPORT_FULLLOGS'))
402 results.logSummary(pn)
403 if not results or not complete:
395 bb.fatal('%s - FAILED - tests were interrupted during execution' % pn, forcelog=True) 404 bb.fatal('%s - FAILED - tests were interrupted during execution' % pn, forcelog=True)
396 configuration = get_testimage_configuration(d, 'runtime', machine)
397 results.logDetails(get_testimage_json_result_dir(d),
398 configuration,
399 get_testimage_result_id(configuration),
400 dump_streams=d.getVar('TESTREPORT_FULLLOGS'))
401 results.logSummary(pn)
402 if not results.wasSuccessful(): 405 if not results.wasSuccessful():
403 bb.fatal('%s - FAILED - check the task log and the ssh log' % pn, forcelog=True) 406 bb.fatal('%s - FAILED - check the task log and the ssh log' % pn, forcelog=True)
404 407