Repository navigation
TEST: harden async lifecycle test observation - #3122
Merged
Richard Lundeen (richlundeen) merged 2 commits intoOct 11, 2026
Merged
Richard Lundeen (richlundeen) merged 2 commits into
Richard Lundeen (richlundeen) merged 2 commits into
Conversation
Use event-controlled Copilot session retirement and FIFO handoff gates with deterministic blocked-watchdog regressions. Preserve original cancellation and durable queue behavior, and release and drain owned tasks before mock teardown. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Richard Lundeen (richlundeen)
approved these changes
Oct 11, 2026
Richard Lundeen (richlundeen)
enabled auto-merge
October 11, 2026 19:25
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 11, 2026
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 Copilot session-retirement and FIFO scenario-launch tests have failed in the merge queue with short coordination deadlines. Their
asyncio.wait_forwatchdogs could cancel the operation being observed, including adding a second cancellation while session deletion was pending or cancelling the final scenario execution instead of simply reporting a timeout.Reuse the existing
wait_for_completion_asynchelper from #3011 to bound observation without injecting cancellation:timeout=0while its dependency remains blocked. The operation must stay pending and finish correctly after release. Release and drain all owned tasks infinallybefore mocks are removed, including shielded target cleanup and scheduler handoff tasks.Only the two test files change. No production deadlines, APIs, cancellation semantics, shared helpers or fixtures, dependency manifests, coverage thresholds, or CI gates change.
Tests and Documentation
Validation on Windows with CPython 3.14.4 and github-copilot-sdk 1.0.16. SDK I/O remained mocked and memory isolated.
Both complete files: 265 passed in each of two runs; the final run reported 20 existing deprecation warnings.
Repeated xdist controls: five independent runs, six passed per run, with no failure reruns.
Lint, formatting, and applicable hooks: passed, including hooks during commit.
Deterministic negative controls: in separate Python processes, substituting the legacy observer produced three expected cancellation-assertion failures. A selective legacy observer on FIFO final execution produced one expected failure because the executor swallowed the injected cancellation and
wait_forreturned without raising the watchdog timeout. The finalizers drained owned work in these failure paths.Type-check limitation: the following command reports one unrelated, pre-existing
redundant-condition-strictdiagnostic at Copilot test line 898 (if reset_task is not None; upstream line 897). The unchanged baseline had two diagnostics; this changeset removes the other and introduces none. The production-only type-check hook does not apply to these test files.Linux/CI and Python 3.11 were not run locally. Documentation changes are not applicable to this test-only fix.
JupyText: not run; no notebooks or documentation code changed.