mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-05-23 16:35:59 +00:00
fix run manager test cleanup await
This commit is contained in:
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import re
|
import re
|
||||||
from contextlib import suppress
|
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
@@ -298,13 +297,14 @@ async def test_create_does_not_expose_run_until_store_persist_completes():
|
|||||||
assert [run.run_id for run in runs] == [record.run_id]
|
assert [run.run_id for run in runs] == [record.run_id]
|
||||||
finally:
|
finally:
|
||||||
allow_put.set()
|
allow_put.set()
|
||||||
|
cleanup_tasks = []
|
||||||
for task in (list_task, create_task):
|
for task in (list_task, create_task):
|
||||||
if task is None:
|
if task is None:
|
||||||
continue
|
continue
|
||||||
if not task.done():
|
if not task.done():
|
||||||
task.cancel()
|
task.cancel()
|
||||||
with suppress(asyncio.CancelledError):
|
cleanup_tasks.append(task)
|
||||||
await task
|
await asyncio.gather(*cleanup_tasks, return_exceptions=True)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.anyio
|
@pytest.mark.anyio
|
||||||
|
|||||||
Reference in New Issue
Block a user