Skip to contentSkip to conversation

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

PATCH New Jan Kiszka 1 participant 1 message Jul 16, 2021

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH v2 1/1 testsuite/smokey: posix-mutex: Expand mutex holding time when running in VM

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:

posix-mutex.c:510, FAILED: get_effective_prio() == prio (=false)

Expand to 50 ms in such setups.

---

Changes in v2:
- reduce to 50 ms so that check_time_limit does not trigger

 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..9a55d0973a 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 50ms in VM) from now */
+	timespec_adds(&ts, &now, smokey_on_vm ? 50000000 : 5000000);
 
 	if (p->barrier)
 		smokey_barrier_release(p->barrier);
Signature · 1 line
2.26.2