From f7f8e8cbb953686c520969a66a9718675a972af5 Mon Sep 17 00:00:00 2001 From: Evgeny Vereshchagin Date: Sat, 17 Nov 2018 20:36:31 +0100 Subject: [PATCH] test: kill all processes launched by test-execute before exiting As was shown in https://github.com/systemd/systemd/issues/10696#issuecomment-439613204, currently `meson` waits for 1080 seconds (which is three times the global timeout) for the test to fail completely even though it takes just two minutes for it to really fail. This happens because the test itself leaves the services it has launched behind, which, in turn, makes meson think that the test is still in progress. KILL_ALL with SIGKILL should make the issue go away. --- src/test/test-execute.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/test/test-execute.c b/src/test/test-execute.c index e6715f95749..0e378f68c01 100644 --- a/src/test/test-execute.c +++ b/src/test/test-execute.c @@ -54,6 +54,9 @@ static void check(Manager *m, Unit *unit, int status_expected, int code_expected n = now(CLOCK_MONOTONIC); if (ts + timeout < n) { log_error("Test timeout when testing %s", unit->id); + r = UNIT_VTABLE(unit)->kill(unit, KILL_ALL, 9, NULL); + if (r < 0) + log_error_errno(r, "Failed to kill %s: %m", unit->id); exit(EXIT_FAILURE); } } -- 2.39.2