From 0fd81174343b675147ba5de55d48b24c90ac4564 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 7 Jul 2023 12:48:30 -0400 Subject: [PATCH] MT#56374 cap sleep time under ASAN We don't have functioning thread cancellation under ASAN. Make sure our timer threads don't sleep too long so that the tests don't time out. Change-Id: Iced6396fc500942ae64dfe8d8a5fb81c6a5e9619 --- daemon/helpers.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/daemon/helpers.c b/daemon/helpers.c index 119c3bf43..9e49062fa 100644 --- a/daemon/helpers.c +++ b/daemon/helpers.c @@ -316,6 +316,9 @@ static void thread_looper_helper(void *fp) { g_slice_free1(sizeof(*lhp), lhp); long long interval_us = lh.interval_us; +#ifdef ASAN_BUILD + interval_us = MIN(interval_us, 100000); +#endif static const long long warn_limit_pct = 20; // 20% long long warn_limit_us = interval_us * warn_limit_pct / 100;