Skip to content

Commit

Permalink
tests: spinlock: Increase thread execution to prevent quick exit
Browse files Browse the repository at this point in the history
On Intel boards (like intel_ehl_crb and intel_rpl_s_crb) for the
trylock_test some part is executed very fast and since there is no
synchronization, there might be situation when there is no
trylock_failures. Increasing time spend in this part fixes the issue.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
  • Loading branch information
finikorg authored and carlescufi committed Sep 28, 2023
1 parent 2b92598 commit a3959af
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/kernel/spinlock/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ void bounce_once(int id, bool trylock)
*/
bounce_owner = id;

for (i = 0; i < 100; i++) {
for (i = 0; i < 5; i++) {
zassert_true(bounce_owner == id, "Locked data changed");
k_busy_wait(1);
}

/* Release the lock */
Expand Down

0 comments on commit a3959af

Please sign in to comment.