diff --git a/meta/classes-recipe/testimage.bbclass b/meta/classes-recipe/testimage.bbclass
index 1bf0cb450ce4..6b10c1db09f9 100644
--- a/meta/classes-recipe/testimage.bbclass
+++ b/meta/classes-recipe/testimage.bbclass
@@ -393,7 +393,6 @@ def testimage_main(d):
         results = tc.results
     finally:
         signal.signal(signal.SIGTERM, orig_sigterm_handler)
-        tc.target.stop()
 
     # Show results (if we have them)
     if results:
@@ -404,6 +403,8 @@ def testimage_main(d):
                         dump_streams=d.getVar('TESTREPORT_FULLLOGS'))
         results.logSummary(pn)
 
+    tc.target.stop()
+
     # Copy additional logs to tmp/log/oeqa so it's easier to find them
     targetdir = os.path.join(get_testimage_json_result_dir(d), d.getVar("PN"))
     os.makedirs(targetdir, exist_ok=True)
@@ -415,6 +416,7 @@ def testimage_main(d):
     if not results.wasSuccessful():
         bb.fatal('%s - FAILED - also check the logs in %s' % (pn, d.getVar("LOG_DIR")), forcelog=True)
 
+
 def get_runtime_paths(d):
     """
     Returns a list of paths where runtime test must reside.
