Skip to contentSkip to conversation

testsuite/smokey: posix-mutex:

PATCH In review Jan Kiszka 1 participant 2 messages Jul 16, 2021

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 testsuite/smokey: posix-mutex:

From: Jan Kiszka <[email protected]>

When running in QEMU, the 5 ms holding time of mutex_timed_locker may be too short when the host is busy. This occasionally leads to failing tests in our CI. Expand to 100 ms then.

---
 testsuite/smokey/posix-mutex/posix-mutex.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
testsuite/smokey/posix-mutex/posix-mutex.c +2 -1
index 3a88532a30..f64ada346c 100644
@@ -170,7 +170,8 @@ static void *mutex_timed_locker(void *arg)
 	int ret;
 
 	clock_gettime(CLOCK_REALTIME, &now);
-	timespec_adds(&ts, &now, 5000000); /* 5ms from now */
+	/* 5ms (or 100ms in VM) from now */
+	timespec_adds(&ts, &now, smokey_on_vm ? 100000000 : 5000000);
 
 	if (p->barrier)
 		smokey_barrier_release(p->barrier);
Signature · 1 line
2.26.2
author
#1 lore raw
Quoted 17 lines · Jan Kiszka

From: Jan Kiszka <[email protected]>

When running in QEMU, the 5 ms holding time of mutex_timed_locker may be too short when the host is busy. This occasionally leads to failing tests in our CI. Expand to 100 ms then.

---
 testsuite/smokey/posix-mutex/posix-mutex.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
testsuite/smokey/posix-mutex/posix-mutex.c +0 -0
index 3a88532a30..f64ada346c 100644

testsuite/smokey/posix-mutex/posix-mutex.c static void *mutex_timed_locker(void *arg) · line 177

Quoted 9 lines
testsuite/smokey/posix-mutex/posix-mutex.c +2 -1
@@ -170,7 +170,8 @@ static void *mutex_timed_locker(void *arg)
 	int ret;
 
 	clock_gettime(CLOCK_REALTIME, &now);
-	timespec_adds(&ts, &now, 5000000); /* 5ms from now */
+	/* 5ms (or 100ms in VM) from now */
+	timespec_adds(&ts, &now, smokey_on_vm ? 100000000 : 5000000);
 
 	if (p->barrier)
 		smokey_barrier_release(p->barrier);

Argh, unfinished subject:

"testsuite/smokey: posix-mutex: Expand mutex holding time when running in VM"

Jan

Signature · 2 lines
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux