Skip to content

Commit faf517c

Browse files
committed
tests: give aplaymidi some time to start
1 parent 9b91b98 commit faf517c

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

tests/test_event_async_input.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ async def test_event_input(asyncio_latency_check):
4040
filename = os.path.join(DATA_DIR, "c_major.mid")
4141
cmd = ["aplaymidi", "-p", str(Address(port)), "-d", "0", filename]
4242
player = subprocess.Popen(cmd)
43+
44+
# give it a bit time to start, the VM might be slow
45+
await asyncio.sleep(0.5)
4346
await asyncio_latency_check.cont()
4447

4548
events = []

tests/test_event_input.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ def test_event_input():
4040
cmd = ["aplaymidi", "-p", str(Address(port)), "-d", "0", filename]
4141
player = subprocess.Popen(cmd)
4242

43+
# give it a bit time to start, the VM might be slow
44+
time.sleep(0.5)
45+
4346
events = []
4447
for _ in range(18):
4548
event = client.event_input(timeout=1)
@@ -84,6 +87,9 @@ def test_event_input_bytes():
8487
event = client.event_input(timeout=1, prefer_bytes=True)
8588
assert isinstance(event, PortSubscribedEvent)
8689

90+
# give it a bit time to start, the VM might be slow
91+
time.sleep(0.5)
92+
8793
for _ in range(8):
8894
event = client.event_input(timeout=1, prefer_bytes=True)
8995
assert isinstance(event, MidiBytesEvent)

0 commit comments

Comments
 (0)