diff --git a/src/accelerate/test_utils/testing.py b/src/accelerate/test_utils/testing.py index 6c8e9b0d7e4..b10ab1f15cd 100644 --- a/src/accelerate/test_utils/testing.py +++ b/src/accelerate/test_utils/testing.py @@ -338,8 +338,8 @@ def tee(line, sink, pipe, label=""): # XXX: the timeout doesn't seem to make any difference here await asyncio.wait( [ - _read_stream(p.stdout, lambda l: tee(l, out, sys.stdout, label="stdout:")), - _read_stream(p.stderr, lambda l: tee(l, err, sys.stderr, label="stderr:")), + asyncio.create_task(_read_stream(p.stdout, lambda l: tee(l, out, sys.stdout, label="stdout:"))), + asyncio.create_task(_read_stream(p.stderr, lambda l: tee(l, err, sys.stderr, label="stderr:"))), ], timeout=timeout, )