From cbc5fdbb4b6eef4caf42c3303786c924f4c59dcc Mon Sep 17 00:00:00 2001 From: S Swetha Date: Fri, 21 Mar 2025 00:49:56 +0530 Subject: [PATCH] tests: kernel: spinlock: Increase lock contention This commit resolves lock contention issues by increasing the probablity of contention during the test execution. Increased wait delay when lock is taken and Reduced wait delay when the lock is released. Achieved 99% lock contention probablity, verified through runtime metrices. Signed-off-by: S Swetha --- tests/kernel/spinlock/src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/kernel/spinlock/src/main.c b/tests/kernel/spinlock/src/main.c index 1e5de11ff00..61447411714 100644 --- a/tests/kernel/spinlock/src/main.c +++ b/tests/kernel/spinlock/src/main.c @@ -83,7 +83,7 @@ static void bounce_once(int id, bool trylock) } k_spin_unlock(&bounce_lock, key); - k_busy_wait(100); + k_busy_wait(1); } if (!locked && bounce_done) { @@ -99,7 +99,7 @@ static void bounce_once(int id, bool trylock) for (i = 0; i < 5; i++) { zassert_true(bounce_owner == id, "Locked data changed"); - k_busy_wait(1); + k_busy_wait(5); } /* Release the lock */