pespin has submitted this change. (
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39127?usp=email )
Change subject: testenv: Log return code of unexpected end of process
......................................................................
testenv: Log return code of unexpected end of process
This providing further information, for instance if the process actually
exited due to a signal (rc < 0) or due to exiting on its own (rc >= 0).
While at it, rewrite the log line since a process exiting doesn't
necessarily mean it crashed.
Change-Id: I7bbee6ad8e114eeb1ef348184158230b53d0f3cf
---
M _testenv/testenv/daemons.py
1 file changed, 4 insertions(+), 2 deletions(-)
Approvals:
osmith: Looks good to me, approved
Jenkins Builder: Verified
fixeria: Looks good to me, but someone else must approve
diff --git a/_testenv/testenv/daemons.py b/_testenv/testenv/daemons.py
index 86f3979..da8248e 100644
--- a/_testenv/testenv/daemons.py
+++ b/_testenv/testenv/daemons.py
@@ -107,9 +107,11 @@
def check_if_crashed():
crashed = False
+ returncode = None
for daemon_name, daemon_proc in daemons.items():
if not testenv.testsuite.is_running(daemon_proc.pid):
crashed = True
+ returncode = daemon_proc.poll()
break
if not crashed:
return
@@ -118,10 +120,10 @@
testenv.coredump.get_from_coredumpctl()
if current_test:
- logging.error(f"{daemon_name} crashed during {current_test}!")
+ logging.error(f"{daemon_name} unexpected exit during {current_test}!
rc={returncode}")
testenv.testsuite.wait_until_test_stopped()
else:
- logging.error(f"{daemon_name} crashed!")
+ logging.error(f"{daemon_name} unexpected exit! rc={returncode}")
sys.exit(1)
--
To view, visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39127?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I7bbee6ad8e114eeb1ef348184158230b53d0f3cf
Gerrit-Change-Number: 39127
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>