Skip to content

Bound ManagedSession reconnect cleanup - #4276

Draft
marcschier with Copilot wants to merge 2 commits into
masterfrom
copilot/fix-flaky-ci-hang-reconnect-test
Draft

Bound ManagedSession reconnect cleanup#4276
marcschier with Copilot wants to merge 2 commits into
masterfrom
copilot/fix-flaky-ci-hang-reconnect-test

Conversation

Copilot AI commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Description

Reconnect integration cleanup could wait indefinitely on a dead transport, allowing a single stalled test to terminate the Sessions test host.

  • Bounded test cleanup

    • Uses an independent 30-second cancellation token for CloseAsync.
    • Bounds DisposeAsync with a separate 30-second timeout.
  • Non-blocking product disposal

    • Session.DisposeAsync sends CloseSession immediately without awaiting its response.
    • ManagedSession.DisposeAsync delegates inner-session disposal to this path.
Task closeSessionTask = base.CloseSessionAsync(
    null,
    DeleteSubscriptionsOnClose,
    default).AsTask();
_ = ObserveCloseSessionAsync(closeSessionTask);
  • Regression coverage
    • Verifies disposal completes after dispatching CloseSession when the response never arrives.

Related Issues

Checklist

  • I have signed the CLA and read the CONTRIBUTING doc.
  • I have added tests that prove my fix is effective or that my feature works and increased code coverage.
  • I have added all necessary documentation.
  • I have verified that my changes do not introduce (new) build or analyzer warnings.
  • I ran all tests locally using the UA.slnx solution against at least .net framework and .net 10, and all passed.
  • I fixed all failing and flaky tests in the CI pipelines and all CodeQL warnings.
  • I have addressed all PR feedback received.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Co-authored-by: marcschier <11168470+marcschier@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix flaky CI hang in reconnect-test cleanup Bound ManagedSession reconnect cleanup Aug 18, 2026
Copilot AI requested a review from marcschier August 18, 2026 18:38
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.

Flaky CI hang: unbounded ManagedSession reconnect-test cleanup can crash the whole Sessions test host

3 participants