Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t v1] tests/intel/xe_gt_freq: Change basic throttle API test criteria
@ 2024-11-05  6:32 Raag Jadav
  2024-11-05  9:50 ` ✓ Fi.CI.BAT: success for " Patchwork
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Raag Jadav @ 2024-11-05  6:32 UTC (permalink / raw)
  To: lucas.demarchi, John.C.Harrison, sujaritha.sundaresan,
	rodrigo.vivi, matthew.d.roper, andi.shyti
  Cc: igt-dev, anshuman.gupta, badal.nilawar, riana.tauro, Raag Jadav

Basic throttle API test is implemented in a way that expects multiple
sysfs reads to provide atomic results. Since atomicity is never guaranteed
between multiple sysfs reads, this is an incorrect expection from the test.
Change the test criteria to check for boolean value from throttle status
and throttle reasons sysfs entries.

Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/3254
Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/3147
Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/2810
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
 tests/intel/xe_gt_freq.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/tests/intel/xe_gt_freq.c b/tests/intel/xe_gt_freq.c
index de4d111ea..632415d33 100644
--- a/tests/intel/xe_gt_freq.c
+++ b/tests/intel/xe_gt_freq.c
@@ -121,10 +121,8 @@ static void test_throttle_basic_api(int fd, int gt_id)
 	reasons |= get_throttle(fd, gt_id, "reason_vr_tdc");
 	reasons |= get_throttle(fd, gt_id, "reason_vr_thermalert");
 
-	if (status)
-		igt_assert(reasons);
-	else
-		igt_assert(!reasons);
+	igt_assert(status == true || status == false);
+	igt_assert(reasons == true || reasons == false);
 }
 
 /**
-- 
2.34.1


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

end of thread, other threads:[~2024-11-06 11:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-05  6:32 [PATCH i-g-t v1] tests/intel/xe_gt_freq: Change basic throttle API test criteria Raag Jadav
2024-11-05  9:50 ` ✓ Fi.CI.BAT: success for " Patchwork
2024-11-05 10:48 ` ✓ CI.xeBAT: " Patchwork
2024-11-05 16:09 ` [PATCH i-g-t v1] " Rodrigo Vivi
2024-11-06  5:20   ` Riana Tauro
2024-11-06  7:22   ` Raag Jadav
2024-11-06  4:44 ` ✗ Fi.CI.IGT: failure for " Patchwork
2024-11-06 11:41 ` ✗ CI.xeFULL: " Patchwork

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