Skip to content

Commit

Permalink
Return error code 3 for callback errors
Browse files Browse the repository at this point in the history
Signed-off-by: mulhern <[email protected]>
  • Loading branch information
mulkieran committed Jul 2, 2024
1 parent 1467204 commit 70a827b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
9 changes: 5 additions & 4 deletions scripts/monitor_dbus_signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,10 +685,6 @@ def _check():
if _PROPERTIES is None:
return []

assert isinstance(_CALLBACK_ERRORS, list)
if _CALLBACK_ERRORS:
return _CALLBACK_ERRORS

if _MO is None:
return []

Expand Down Expand Up @@ -730,6 +726,11 @@ def _check():

return diffs

assert isinstance(_CALLBACK_ERRORS, list)
if _CALLBACK_ERRORS:
print(os.linesep.join(_CALLBACK_ERRORS))
sys.exit(3)

result = _check()

assert isinstance(result, list)
Expand Down
6 changes: 6 additions & 0 deletions testlib/infra.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,12 @@ def run_check(self, stop_time):
time.sleep(sleep_time(stop_time, 16))
self.trace.send_signal(signal.SIGINT)
(stdoutdata, stderrdata) = self.trace.communicate()
if self.trace.returncode == 3:
raise RuntimeError(
"Failure while processing D-Bus signals: "
f'stderr: {stderrdata.decode("utf-8")}, '
f'stdout: {stdoutdata.decode("utf-8")}'
)
msg = stdoutdata.decode("utf-8")
self.assertEqual(
self.trace.returncode,
Expand Down

0 comments on commit 70a827b

Please sign in to comment.