osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38620?usp=email )
Change subject: testenv: fix 'container crashed' detection ......................................................................
testenv: fix 'container crashed' detection
* When the testsuite stopped and using podman, check if it stopped because the container crashed and raise an exception.
* Even after 9eb5e696 ("testenv: make podman stop more robust") it happens sometimes in jenkins that the container gets stopped on purpose because the testsuite is done, but then the watchdog process prints an error saying it crashed (without actually stopping testenv at this point). Change the message to a debug message that just says it stopped, this should not be an error.
Related: OS#6607 Change-Id: I3c116719cdc00a99e27e5237ba3d57d5258b0919 --- M _testenv/testenv/podman.py M _testenv/testenv/testsuite.py 2 files changed, 3 insertions(+), 1 deletion(-)
Approvals: Jenkins Builder: Verified fixeria: Looks good to me, approved pespin: Looks good to me, but someone else must approve
diff --git a/_testenv/testenv/podman.py b/_testenv/testenv/podman.py index 719afcb..dc1b333 100644 --- a/_testenv/testenv/podman.py +++ b/_testenv/testenv/podman.py @@ -179,7 +179,7 @@ time.sleep(5) p = subprocess.run(["podman", "exec", container_name, "touch", "/tmp/watchdog"]) if p.returncode: - logging.error("podman container crashed!") + logging.debug("feed_watchdog_loop: podman container has stopped") return except KeyboardInterrupt: pass diff --git a/_testenv/testenv/testsuite.py b/_testenv/testenv/testsuite.py index 601f339..3bc8d9d 100644 --- a/_testenv/testenv/testsuite.py +++ b/_testenv/testenv/testsuite.py @@ -195,6 +195,8 @@ time.sleep(1)
if not is_running(testsuite_proc.pid): + if testenv.args.podman and not testenv.podman.is_running(): + raise testenv.NoTraceException("podman container crashed!") logging.debug("Testsuite is done") stop() break