From e6e9313af38dc4e6f650ac893b712eaa058b0b5a Mon Sep 17 00:00:00 2001 From: jaseg Date: Sun, 25 Aug 2024 13:45:13 +0200 Subject: Tests: Fix race condition in test_wait_for_property_concurrency --- tests/test_mpv.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_mpv.py b/tests/test_mpv.py index a59ade1..9c42332 100755 --- a/tests/test_mpv.py +++ b/tests/test_mpv.py @@ -49,7 +49,8 @@ def timed_print(): start_time = time.time() def do_print(level, prefix, text): td = time.time() - start_time - print('{:.3f} [{}] {}: {}'.format(td, level, prefix, text), flush=True) + print('{:.3f} [{}] {}: {}'.format(td, level, prefix, text.strip()), flush=True) + return do_print class MpvTestCase(unittest.TestCase): @@ -922,11 +923,10 @@ class RegressionTests(MpvTestCase): def test_wait_for_property_concurrency(self): players = [mpv.MPV(vo=testvo, loglevel='debug', log_handler=timed_print()) for i in range(2)] - try: for _ in range(150): for player in players: - player.play('tests/test.webm') + player.loadfile('tests/test.webm', loop='inf') for player in players: player.wait_for_property('seekable') for player in players: -- cgit