From 180f7c764ae9dbe85bfd281f62f6086cf95e5b7a Mon Sep 17 00:00:00 2001 From: Patrick Vacek Date: Tue, 30 Apr 2019 16:04:35 +0200 Subject: selftest: retry aktualizr failure check due to resource constraints. For some reason it now often fails if you don't briefly pause first, so just retry it if it fails a few times. Signed-off-by: Patrick Vacek --- lib/oeqa/selftest/cases/updater_qemux86_64.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lib/oeqa') diff --git a/lib/oeqa/selftest/cases/updater_qemux86_64.py b/lib/oeqa/selftest/cases/updater_qemux86_64.py index c928093..9f32bcf 100644 --- a/lib/oeqa/selftest/cases/updater_qemux86_64.py +++ b/lib/oeqa/selftest/cases/updater_qemux86_64.py @@ -408,11 +408,18 @@ class ResourceControlTests(OESelftestTestCase): def test_aktualizr_resource_control(self): print('Checking aktualizr was killed') - stdout, stderr, retcode = self.qemu_command('systemctl --no-pager show aktualizr') + ran_ok = False + for delay in [5, 5, 5, 5]: + sleep(delay) + stdout, stderr, retcode = self.qemu_command('systemctl --no-pager show aktualizr') + if retcode == 0 and b'ExecMainStatus=9' in stdout: + ran_ok = True + break + self.assertTrue(ran_ok, 'Aktualizr was not killed') + self.assertIn(b'CPUWeight=1000', stdout, 'CPUWeight was not set correctly') self.assertIn(b'MemoryHigh=52428800', stdout, 'MemoryHigh was not set correctly') self.assertIn(b'MemoryMax=1048576', stdout, 'MemoryMax was not set correctly') - self.assertIn(b'ExecMainStatus=9', stdout, 'Aktualizr was not killed') self.qemu_command('systemctl --runtime set-property aktualizr MemoryMax=') self.qemu_command('systemctl restart aktualizr') -- cgit v1.2.3-54-g00ecf