Skip to content

detect leaked tasks on tests #1993

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 16, 2025
Merged

detect leaked tasks on tests #1993

merged 5 commits into from
Apr 16, 2025

Conversation

theomonnom
Copy link
Member

app        | ==================================== ERRORS ====================================
app        | ____________ ERROR at teardown of test_synthesize_timeout[cartesia] ____________
app        | .venv/lib/python3.9/site-packages/pytest_asyncio/plugin.py:363: in finalizer
app        |     event_loop.run_until_complete(task)
app        | /usr/local/lib/python3.9/asyncio/base_events.py:647: in run_until_complete
app        |     return future.result()
app        | .venv/lib/python3.9/site-packages/pytest_asyncio/plugin.py:354: in async_finalizer
app        |     await gen_obj.__anext__()  # type: ignore[union-attr]
app        | tests/conftest.py:119: in fail_on_leaked_tasks
app        |     pytest.fail(final_msg)
app        | E   Failed: Test leaked resources:
app        | E   
app        | E   Leaked async generators detected:
app        | E     - Async generator with id: 281472563032128
app        | ______________ ERROR at teardown of test_synthesize_timeout[aws] _______________
app        | .venv/lib/python3.9/site-packages/pytest_asyncio/plugin.py:363: in finalizer
app        |     event_loop.run_until_complete(task)
app        | /usr/local/lib/python3.9/asyncio/base_events.py:647: in run_until_complete
app        |     return future.result()
app        | .venv/lib/python3.9/site-packages/pytest_asyncio/plugin.py:354: in async_finalizer
app        |     await gen_obj.__anext__()  # type: ignore[union-attr]
app        | tests/conftest.py:119: in fail_on_leaked_tasks
app        |     pytest.fail(final_msg)
app        | E   Failed: Test leaked resources:
app        | E   
app        | E   Leaked tasks detected:
app        | E   Task Name    : TTS._synthesize_task
app        | E   Coroutine    : ChunkedStream._main_task
app        | E   Location     : /app/livekit-agents/livekit/agents/tts/tts.py:203
app        | E   State        : pending
app        | E   
app        | E   Task Name    : TTS._metrics_task
app        | E   Coroutine    : ChunkedStream._metrics_monitor_task
app        | E   Location     : /app/livekit-agents/livekit/agents/tts/tts.py:164
app        | E   State        : pending
app        | E   
app        | E   Leaked async generators detected:
app        | E     - Async generator with id: 281473126488096
app        | E     - Async generator with id: 281473126487952

@theomonnom theomonnom requested a review from a team April 14, 2025 12:30
@theomonnom theomonnom merged commit 2006ca4 into main Apr 16, 2025
4 of 6 checks passed
@theomonnom theomonnom deleted the theo/detect-leaks branch April 16, 2025 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant