1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-24 14:03:55 +01:00

Merge pull request #14271 from keestux/fix-test-xtimer_mutex_lock_timeout

tests/xtimer_mutex_lock_timeout: don't assume number of threads at start
This commit is contained in:
Alexandre Abadie 2020-06-15 09:50:18 +02:00 committed by GitHub
commit 57809d65a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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")