summaryrefslogtreecommitdiff
path: root/tests/drm_import_export.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2019-01-16 13:08:11 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2019-01-16 14:04:22 +0000
commit08ac42b8c6892a9c8447ceefd931bc4394bef8fb (patch)
treec6dc003bf0f33fedaa9e5f42c9bc260e05625706 /tests/drm_import_export.c
parenta265766a7afdee654b331ed40bed996be02cf72a (diff)
drm/drm_import_export: Replace imprecise loop-bound with timeout
Use a specific timeout to exercise the race conditions, rather than a number of tries -- this prevents it burning up too many minutes under CI for little gain, we can just run it again to improve race detection. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108667 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Diffstat (limited to 'tests/drm_import_export.c')
-rw-r--r--tests/drm_import_export.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/tests/drm_import_export.c b/tests/drm_import_export.c
index e3ce2480..4bc7b7d4 100644
--- a/tests/drm_import_export.c
+++ b/tests/drm_import_export.c
@@ -129,8 +129,6 @@ static void * test_thread(void * par)
return NULL;
}
-#define IMPORT_RACE_LOOPS 100000
-
struct import_race_thread_data {
int prime_fd;
uint32_t flink_name;
@@ -189,7 +187,6 @@ static void *import_close_thread(void *data)
static void test_import_close_race(void)
{
pthread_t t;
- unsigned int loops = IMPORT_RACE_LOOPS;
drm_intel_bo *bo;
struct import_race_thread_data t_data;
@@ -199,7 +196,7 @@ static void test_import_close_race(void)
igt_assert_eq(pthread_create(&t, NULL, import_close_thread , &t_data), 0);
- while (loops--) {
+ igt_until_timeout(15) {
bo = drm_intel_bo_alloc(bufmgr, "buf-shared", 4096, 4096);
igt_assert(bo != NULL);
/*