Repository navigation
TEST Harden media cleanup test task ownership - #3282
Open
Roman Lutz (romanlutz) wants to merge 2 commits into
Open
Roman Lutz (romanlutz) wants to merge 2 commits into
Roman Lutz (romanlutz) wants to merge 2 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: abe68236-1370-4206-b69d-2a72e999262c
Reuse the merged watchdog helper and preserve the media test's early-failure propagation and failure-safe task cleanup. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: abe68236-1370-4206-b69d-2a72e999262c
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The interrupted-media-write test can leave its save task running when its readiness wait times out. That task can outlive the write mock and database fixture, masking the original failure or persisting data after the test has failed. This was found while investigating the macOS failure affecting #3266.
Wait for either write readiness or save completion so early save errors surface immediately. Reuse the shared 300-second correctness watchdog, and release the shielded writer and drain both owned tasks in
finallybefore removing the mock. The existing error and cancellation assertions remain intact.This is a focused follow-up to the merged timeout work in #3254, #3268, and #3278. It reuses main's helper unchanged and makes no production-code or production-deadline changes.
Tests and Documentation
Updated the testing guide with readiness, task ownership, and failure-path cleanup guidance.
Validation after merging main:
uv run --frozen pytest tests\unit\backend\test_conversation_editor.py tests\unit\memory\test_attack_analytics_eval_identity.py tests\unit\test_async_utils.py -q: passed, 100 tests.uv run --frozen ruff check tests\unit\backend\test_conversation_editor.py: passed.uv run --frozen ruff format --check tests\unit\backend\test_conversation_editor.py: passed.uv run --frozen ty check tests\unit\backend\test_conversation_editor.py: passed.git diff --check: passed. Commit hooks, including documentation validation, passed.Earlier controlled local probes confirmed that a six-second write delay passes, forced watchdog expiry drains the tasks and removes media, and an early database failure surfaces its original exception without unfinished tasks. Native macOS and the full optional-dependency matrix were not run locally.
JupyText: not run; no notebooks or executable documentation examples changed.