Commit ea7015f1 authored by Chris Wilson's avatar Chris Wilson 😣

lib/core: Don't leak dummyloads between subtests

If a test fails or skips early, it may not clean up after itself. In
lieu of having a framework for test deconstructors, hook
igt_terminate_spin_batches() into exit_subtest() itself so that we don't
allow a recursive batch from an earlier test to leak into the next and
cause an unexpected GPU hang.

Similarly, we also want to terminate the dummyload as the first step in
our atexit handlers (currently it is at the start of the last step) as
some atexit handlers may be unwittingly exposed to dummyloads and so
cause another wait on GPU hang.

We trust that the core already distinguishes correctly between the
principal test process and its children.
Signed-off-by: Chris Wilson's avatarChris Wilson <>
Cc: Tvrtko Ursulin <>
Reviewed-by: Tvrtko Ursulin's avatarTvrtko Ursulin <>
parent bab762dd
......@@ -63,6 +63,7 @@
#include "intel_chipset.h"
#include "intel_io.h"
#include "igt_debugfs.h"
#include "igt_dummyload.h"
#include "version.h"
#include "config.h"
......@@ -994,6 +995,8 @@ static void exit_subtest(const char *result)
(!__igt_plain_output) ? "\x1b[0m" : "");
in_subtest = NULL;
siglongjmp(igt_subtest_jmpbuf, 1);
......@@ -1817,6 +1820,8 @@ static void call_exit_handlers(int sig)
int i;
if (!exit_handler_count) {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment