Skip to contentSkip to conversation

oeqa/runtime: fix race-condition in minidebuginfo test

PATCH Superseded [email protected] 2 participants 2 messages Jun 10, 2024

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 oeqa/runtime: fix race-condition in minidebuginfo test

From: Etienne Cordonnier <[email protected]>

Fix this error where 'coredumpctl info' warns that the coredump is still being processed:

```
AssertionError: 1 != 0 : MiniDebugInfo Test failed: No match found.
-- Notice: 1 [email protected] unit is running, output may be incomplete.
```
---
 meta/lib/oeqa/runtime/cases/systemd.py | 9 +++++++++
 1 file changed, 9 insertions(+)
meta/lib/oeqa/runtime/cases/systemd.py +9 -0
index 80fdae240a..7b3cb53e29 100644
@@ -155,6 +155,15 @@ class SystemdServiceTests(SystemdTest):
         self.target.run('kill -SEGV %s' % output)
         self.assertEqual(status, 0, msg = 'Not able to find process that runs sleep, output : %s' % output)
 
+        # Give some time to [email protected] to process the coredump
+        for x in range(20):
+            status, output = self.target.run('coredumpctl --quiet --no-pager --no-legend | wc -l')
+            if output == "1":
+                break
+            else:
+                x += 1
+                time.sleep(1)
+
         (status, output) = self.target.run('coredumpctl info')
         self.assertEqual(status, 0, msg='MiniDebugInfo Test failed: %s' % output)
         self.assertEqual('sleep_for_duration (busybox.nosuid' in output or 'xnanosleep (sleep.coreutils' in output,
Signature · 1 line
2.36.1.vfs.0.0
#1 lore raw
Quoted 27 lines · Etienne Cordonnier via lists.openembedded.org

From: Etienne Cordonnier <[email protected]>

Fix this error where 'coredumpctl info' warns that the coredump is still being processed:

```
AssertionError: 1 != 0 : MiniDebugInfo Test failed: No match found.
-- Notice: 1 [email protected] unit is running, output may be incomplete.
```

---
 meta/lib/oeqa/runtime/cases/systemd.py | 9 +++++++++

 1 file changed, 9 insertions(+)
meta/lib/oeqa/runtime/cases/systemd.py +0 -0
index 80fdae240a..7b3cb53e29 100644
@@ -155,6 +155,15 @@ class SystemdServiceTests(SystemdTest):
          self.target.run('kill -SEGV %s' % output)
          self.assertEqual(status, 0, msg = 'Not able to find process that runs sleep, output : %s' % output)


+        # Give some time to [email protected] to process the coredump
+        for x in range(20):
+            status, output = self.target.run('coredumpctl --quiet --no-pager --no-legend | wc -l') +            if output == "1":

Quoted 8 lines

+                break
+            else:
+                x += 1
+                time.sleep(1)
+
         (status, output) = self.target.run('coredumpctl info')
         self.assertEqual(status, 0, msg='MiniDebugInfo Test failed: %s' % output) self.assertEqual('sleep_for_duration (busybox.nosuid' in output or 'xnanosleep (sleep.coreutils' in output,

That looks better, thanks. I suspect you can simplify it a bit further to:

        for x in range(20):
            status, output = self.target.run('coredumpctl --quiet --no-pager --no-legend | wc -l')
            if output == "1":
                break
            time.sleep(1)

Cheers,

Richard