From 2da9d200c865cfe5f00d03cc11c96072b9b2800f Mon Sep 17 00:00:00 2001 From: Kees Bakker Date: Thu, 11 Jun 2020 21:19:55 +0200 Subject: [PATCH] tests/xtimer_mutex_lock_timeout: don't assume number of threads at start When CDC ACM is used as stdio the number of threads-in-use at the start of the test is not always 2, as it used to be. --- tests/xtimer_mutex_lock_timeout/tests/01-run.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/xtimer_mutex_lock_timeout/tests/01-run.py b/tests/xtimer_mutex_lock_timeout/tests/01-run.py index 14170f10dd..dd630eb1aa 100755 --- a/tests/xtimer_mutex_lock_timeout/tests/01-run.py +++ b/tests/xtimer_mutex_lock_timeout/tests/01-run.py @@ -29,14 +29,17 @@ def testfunc(child): child.expect_exact("> ") child.sendline("mutex_timeout_long_locked_low") child.expect("starting test: xtimer mutex lock timeout with thread") - child.expect("threads = 2") + child.expect("threads = (\d+)") + num_threads = int(child.match.group(1)) child.expect("THREAD low prio: start") child.expect("MAIN THREAD: calling xtimer_mutex_lock_timeout") child.expect("OK") - child.expect("threads = 3") + child.expect("threads = (\d+)") + assert int(child.match.group(1)) == num_threads + 1 child.expect("MAIN THREAD: waiting for created thread to end") child.expect("THREAD low prio: exiting low") - child.expect("threads = 2") + child.expect("threads = (\d+)") + assert int(child.match.group(1)) == num_threads child.expect_exact("> ") child.sendline("mutex_timeout_short_locked") child.expect("starting test: xtimer mutex lock timeout with short timeout and locked mutex")