public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Christoph Manszewski <christoph.manszewski@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: "Piotr Rudnicki" <piotr.rudnicki@intel.com>,
	"Dominik Karol Piątkowski" <dominik.karol.piatkowski@intel.com>,
	"Jan Sokolowski" <jan.sokolowski@intel.com>
Subject: [PATCH i-g-t v5 1/5] tests/xe/xe_eudebug: Change pthread_join to pthread_timedjoin_np
Date: Wed, 11 Mar 2026 12:06:38 +0100	[thread overview]
Message-ID: <20260311110636.798120-8-christoph.manszewski@intel.com> (raw)
In-Reply-To: <20260311110636.798120-7-christoph.manszewski@intel.com>

From: Dominik Karol Piątkowski <dominik.karol.piatkowski@intel.com>

Change pthread_join to pthread_timedjoin_np in discovery-race* and
discovery-empty* tests to avoid hang before reaching cleanup in
igt_fixture.

Signed-off-by: Dominik Karol Piątkowski <dominik.karol.piatkowski@intel.com>
Reviewed-by: Piotr Rudnicki <piotr.rudnicki@intel.com>
Link: https://lore.kernel.org/r/20260220153748.210381-8-christoph.manszewski@intel.com
Signed-off-by: Christoph Manszewski <christoph.manszewski@intel.com>
---
 tests/intel/xe_eudebug.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/tests/intel/xe_eudebug.c b/tests/intel/xe_eudebug.c
index 134f31766..6f5103a19 100644
--- a/tests/intel/xe_eudebug.c
+++ b/tests/intel/xe_eudebug.c
@@ -1240,6 +1240,7 @@ static void test_race_discovery(int fd, unsigned int flags, int clients)
 	int count = clients * debuggers_per_client;
 	struct xe_eudebug_session *sessions, *s;
 	struct xe_eudebug_client *c;
+	struct timespec t = {};
 	pthread_t *threads;
 	int i, j;
 
@@ -1270,7 +1271,9 @@ static void test_race_discovery(int fd, unsigned int flags, int clients)
 	}
 
 	for (i = 0; i < count; i++) {
-		pthread_join(threads[i], NULL);
+		igt_assert_eq(clock_gettime(CLOCK_REALTIME, &t), 0);
+		t.tv_sec += XE_EUDEBUG_DEFAULT_TIMEOUT_SEC;
+		igt_assert_eq(pthread_timedjoin_np(threads[i], NULL, &t), 0);
 	}
 
 	for (i = count - 1; i > 0; i--) {
@@ -1322,6 +1325,7 @@ static void test_empty_discovery(int fd, unsigned int flags, int clients)
 	struct xe_eudebug_session **s;
 	pthread_t *threads;
 	int i, expected = flags & DISCOVERY_CLOSE_CLIENT ? 0 : RESOURCE_COUNT;
+	struct timespec t = {};
 
 	igt_assert(flags & (DISCOVERY_DESTROY_RESOURCES | DISCOVERY_CLOSE_CLIENT));
 
@@ -1337,8 +1341,11 @@ static void test_empty_discovery(int fd, unsigned int flags, int clients)
 		pthread_create(&threads[i], NULL, attach_dettach_thread, s[i]);
 	}
 
-	for (i = 0; i < clients; i++)
-		pthread_join(threads[i], NULL);
+	for (i = 0; i < clients; i++) {
+		igt_assert_eq(clock_gettime(CLOCK_REALTIME, &t), 0);
+		t.tv_sec += XE_EUDEBUG_DEFAULT_TIMEOUT_SEC;
+		igt_assert_eq(pthread_timedjoin_np(threads[i], NULL, &t), 0);
+	}
 
 	for (i = 0; i < clients; i++) {
 		xe_eudebug_client_wait_done(s[i]->client);
-- 
2.47.1


  reply	other threads:[~2026-03-11 11:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-11 11:06 [PATCH i-g-t v5 0/5] Improve eudebug test cleanup Christoph Manszewski
2026-03-11 11:06 ` Christoph Manszewski [this message]
2026-03-11 11:06 ` [PATCH i-g-t v5 2/5] lib/xe/xe_eudebug: Modify toggle error handling Christoph Manszewski
2026-03-11 11:06 ` [PATCH i-g-t v5 3/5] xe/xe_eudebug: Add reattach function and make plain connect private Christoph Manszewski
2026-03-11 11:06 ` [PATCH i-g-t v5 4/5] lib/xe/xe_eudebug: Track active debugger sessions and close when disabling Christoph Manszewski
2026-03-11 11:06 ` [PATCH i-g-t v5 5/5] lib/xe/xe_eudebug: Get drm card sysfs path Christoph Manszewski
2026-03-12  0:04 ` ✓ Xe.CI.BAT: success for Improve eudebug test cleanup (rev5) Patchwork
2026-03-12  0:07 ` ✓ i915.CI.BAT: " Patchwork
2026-03-12 19:08 ` ✓ i915.CI.Full: " Patchwork
2026-03-12 19:10 ` ✗ Xe.CI.FULL: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260311110636.798120-8-christoph.manszewski@intel.com \
    --to=christoph.manszewski@intel.com \
    --cc=dominik.karol.piatkowski@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=jan.sokolowski@intel.com \
    --cc=piotr.rudnicki@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox