Skip to content

Commit

Permalink
Tests: Fix race condition in test_wait_for_property_concurrency
Browse files Browse the repository at this point in the history
  • Loading branch information
jaseg committed Aug 25, 2024
1 parent 16cd0b3 commit e6e9313
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_mpv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit e6e9313

Please sign in to comment.