Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/sched: Make timeout KUnit tests faster

As more KUnit tests are introduced to evaluate the basic capabilities of
the `timedout_job()` hook, the test suite will continue to increase in
duration. To reduce the overall running time of the test suite, decrease
the scheduler's timeout for the timeout tests.

Before this commit:

[15:42:26] Elapsed time: 15.637s total, 0.002s configuring, 10.387s building, 5.229s running

After this commit:

[15:45:26] Elapsed time: 9.263s total, 0.002s configuring, 5.168s building, 4.037s running

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Acked-by: Philipp Stanner <phasta@kernel.org>
Link: https://lore.kernel.org/r/20250714-sched-skip-reset-v6-3-5c5ba4f55039@igalia.com
Signed-off-by: Maíra Canal <mcanal@igalia.com>

+5 -3
+5 -3
drivers/gpu/drm/scheduler/tests/tests_basic.c
··· 5 5 6 6 #include "sched_tests.h" 7 7 8 + #define MOCK_TIMEOUT (HZ / 5) 9 + 8 10 /* 9 11 * DRM scheduler basic tests should check the basic functional correctness of 10 12 * the scheduler, including some very light smoke testing. More targeted tests, ··· 30 28 31 29 static int drm_sched_timeout_init(struct kunit *test) 32 30 { 33 - test->priv = drm_mock_sched_new(test, HZ); 31 + test->priv = drm_mock_sched_new(test, MOCK_TIMEOUT); 34 32 35 33 return 0; 36 34 } ··· 270 268 done = drm_mock_sched_job_wait_scheduled(job, HZ); 271 269 KUNIT_ASSERT_TRUE(test, done); 272 270 273 - done = drm_mock_sched_job_wait_finished(job, HZ / 2); 271 + done = drm_mock_sched_job_wait_finished(job, MOCK_TIMEOUT / 2); 274 272 KUNIT_ASSERT_FALSE(test, done); 275 273 276 274 KUNIT_ASSERT_EQ(test, 277 275 job->flags & DRM_MOCK_SCHED_JOB_TIMEDOUT, 278 276 0); 279 277 280 - done = drm_mock_sched_job_wait_finished(job, HZ); 278 + done = drm_mock_sched_job_wait_finished(job, MOCK_TIMEOUT); 281 279 KUNIT_ASSERT_FALSE(test, done); 282 280 283 281 KUNIT_ASSERT_EQ(test,