Skip to content

Commit

Permalink
test fix: multiprocessing Pool randomly got stuck while testing, used…
Browse files Browse the repository at this point in the history
… proposed solution from pytest-dev/pytest#11174
  • Loading branch information
nirdeepdub committed Aug 11, 2024
1 parent 336f74b commit 05b976a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/test_audiosample.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ def test_serializable(small_wav_file, small_mp3_file):
def test_process_pool(small_mp3_file):
au = AudioSample(small_mp3_file, thread_safe=True)
#test in multiple threads, wait for all to finish. this should not crash.
multiprocessing.set_start_method("spawn", force=True)
with multiprocessing.Pool(4) as pool:
pool.map(partial(pool_fn, au, int(au.duration/10)), range(0, int(au.duration), int(au.duration/10)))

Expand Down

0 comments on commit 05b976a

Please sign in to comment.