Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t 0/1] Fix IGT runner error logic when listing subtests
@ 2023-02-20  9:20 Mauro Carvalho Chehab
  2023-02-20  9:20 ` [igt-dev] [PATCH i-g-t 1/1] runner/job_list: return error on crashes while running --list-subtests Mauro Carvalho Chehab
  0 siblings, 1 reply; 2+ messages in thread
From: Mauro Carvalho Chehab @ 2023-02-20  9:20 UTC (permalink / raw)
  To: igt-dev

From: Mauro Carvalho Chehab <mchehab@kernel.org>

Patches may end breaking --list-subtests if they, for instance, have a
pattern like:

	igt_fixture
		fd = drm_open_driver(DRIVER);
	...
	do_something(fd);

	igt_subtest("foo")
		...
	igt_subtest("bar")
		...

As any usage of (fd) will cause a crash. As result, currently IGT
will produce stderror outbut, but will keep executing, producing
a wrong testlist, as "foo" and "bar" won't be listed.

That will also break scripts that would depend on a reliable testlist.

So, return an error on such cases.

Mauro Carvalho Chehab (1):
  runner/job_list: return error on crashes while running --list-subtests

 runner/job_list.c | 1 +
 1 file changed, 1 insertion(+)

-- 
2.39.0

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [igt-dev] [PATCH i-g-t 1/1] runner/job_list: return error on crashes while running --list-subtests
  2023-02-20  9:20 [igt-dev] [PATCH i-g-t 0/1] Fix IGT runner error logic when listing subtests Mauro Carvalho Chehab
@ 2023-02-20  9:20 ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 2+ messages in thread
From: Mauro Carvalho Chehab @ 2023-02-20  9:20 UTC (permalink / raw)
  To: igt-dev

From: Mauro Carvalho Chehab <mchehab@kernel.org>

Changes on tests may break --list-subtests, if they, for instance,
someone adds a code outside igt_subtests that depends on igt_fixture
to run, causing:

	Received signal SIGABRT.
	Stack trace:
	 #0 [fatal_sig_handler+0x17b]
	 #1 [__sigaction+0x50]
	 #2 [__pthread_kill_implementation+0x10c]
	 #3 [gsignal+0x16]
	 #4 [abort+0xd7]
	 #5 [__assert_fail_base.cold+0xf]
	 #6 [__assert_fail+0x46]
	 #7 [internal_assert+0xe5]
	 #8 [igt_fail+0xea]
	 #9 [__igt_fail_assert+0x10e]
	 #10 [xe_number_hw_engines+0x6b]
	 #11 [__igt_unique____real_main1528+0x1ac0]
	 #12 [main+0x23]
	 #13 [__libc_start_call_main+0x80]
	 #14 [__libc_start_main+0x89]
	 #15 [_start+0x25]
	Aborted (core dumped)

IGT runner currently prints the message, but don't ignore the
error. That prevents scripts to rely on the IGT testlist
output, as the list will miss subtests.

So, instead, return an error.

Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
---
 runner/job_list.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/runner/job_list.c b/runner/job_list.c
index a259b9531a58..e6ea836310fd 100644
--- a/runner/job_list.c
+++ b/runner/job_list.c
@@ -130,6 +130,7 @@ static void add_subtests(struct job_list *job_list, struct settings *settings,
 		}
 	} else {
 		fprintf(stderr, "Test binary %s died unexpectedly\n", binary);
+		exit(1);
 	}
 }
 
-- 
2.39.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-20  9:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-20  9:20 [igt-dev] [PATCH i-g-t 0/1] Fix IGT runner error logic when listing subtests Mauro Carvalho Chehab
2023-02-20  9:20 ` [igt-dev] [PATCH i-g-t 1/1] runner/job_list: return error on crashes while running --list-subtests Mauro Carvalho Chehab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox