Fix recording artifact readiness race
This commit is contained in:
@@ -133,6 +133,30 @@ def test_wait_for_file_ready_accepts_valid_wav(tmp_path):
|
||||
assert ready is True
|
||||
|
||||
|
||||
def test_wait_for_recording_artifacts_ready_accepts_tracks_created_during_wait(tmp_path):
|
||||
meeting = tmp_path / "meeting.wav"
|
||||
meeting.write_bytes(b"not a finalized mixed wav")
|
||||
tracks_dir = tmp_path / "tracks"
|
||||
tracks_dir.mkdir()
|
||||
|
||||
async def create_tracks_later():
|
||||
await asyncio.sleep(0.003)
|
||||
alice = tracks_dir / "track-111.wav"
|
||||
alice.write_bytes(b"alice audio")
|
||||
(tracks_dir / "tracks.json").write_text(
|
||||
'{"tracks":[{"display_name":"Alice","path":"' + str(alice) + '"}]}'
|
||||
)
|
||||
|
||||
async def run_wait():
|
||||
writer = asyncio.create_task(create_tracks_later())
|
||||
try:
|
||||
return await bot.wait_for_recording_artifacts_ready(str(meeting), attempts=20, delay=0.001)
|
||||
finally:
|
||||
await writer
|
||||
|
||||
assert asyncio.run(run_wait()) == "tracks"
|
||||
|
||||
|
||||
def test_load_speaker_tracks_resolves_manifest_tracks_next_to_recording(tmp_path):
|
||||
meeting = tmp_path / "meeting.wav"
|
||||
meeting.write_bytes(b"RIFFdemo")
|
||||
|
||||
Reference in New Issue
Block a user