]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa/runtime/ptest: Ensure OOM errors are logged
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 30 Jan 2019 22:01:23 +0000 (22:01 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 31 Jan 2019 23:08:39 +0000 (23:08 +0000)
Currently processed being killed by the OOM killer may not be spotted by
ptest-runner. After we complete the tests, check the logs and report if there
were any. This ensures the user is aware of OOM conditions affecting the
ptest results.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/runtime/cases/ptest.py

index 6ae951356d8e45c9e652619ef09a4d4aeb4cd4e9..2a28ca59a8e50739fbe9bd3219263ac1e9b86adb 100644 (file)
@@ -70,5 +70,13 @@ class PtestRunnerTest(OERuntimeTestCase):
             if failed_testcases:
                 failed_tests[section] = failed_testcases
 
+        failmsg = ""
+        status, output = self.target.run('dmesg | grep "Killed process"', 0)
+        if output:
+            failmsg = "ERROR: Processes were killed by the OOM Killer:\n%s\n" % output
+
         if failed_tests:
-            self.fail("Failed ptests:\n%s" % pprint.pformat(failed_tests))
+            failmsg = failmsg + "Failed ptests:\n%s" % pprint.pformat(failed_tests)
+
+        if failmsg:
+            self.fail(failmsg)