Skip to content

TEST Harden media cleanup test task ownership - #3282

Open
Roman Lutz (romanlutz) wants to merge 2 commits into
microsoft:mainfrom
romanlutz:romanlutz-pr-3266-media-timeout-investigation
Open

Roman Lutz (romanlutz) wants to merge 2 commits into
microsoft:mainfrom
romanlutz:romanlutz-pr-3266-media-timeout-investigation

Conversation

@romanlutz

Copy link
Copy Markdown
Contributor

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 finally before 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.

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

No deployments
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