Skip to content

Quarantine TestServerTests.LongPollingWorks (ObjectDisposedException in DefaultHubDispatcher) #67348

Closed

Description

@github-actions

Failing Test

Microsoft.AspNetCore.SignalR.Client.Tests.TestServerTests.LongPollingWorks

Error Message

System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'IServiceProvider'.

Stacktrace

Stack trace
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'IServiceProvider'.
   at Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher`1.OnDisconnectedAsync(HubLifetimeContext context, Exception exception)
   at Microsoft.AspNetCore.SignalR.HubConnectionHandler`1.RunHubAsync(HubConnectionContext connection)

Logs

Log: TestServerTests_LongPollingWorks.log

Build

Failed in multiple main branch builds. The error occurs in DefaultHubDispatcher.OnDisconnectedAsync when the DI service provider has already been disposed during test teardown, but the hub disconnect handler still tries to access it. This is a timing-dependent failure during long-polling connection cleanup.

Generated by Daily Test Quarantine Management · 5.7K AIC · ⌖ 52 AIC · ⊞ 25.6K · ◷

Activity

  1. github-actions commented on Jun 21, 2026

    @github-actions
    ContributorAuthor

    Investigation

    The test fails with System.ObjectDisposedException: Cannot access a disposed object. Object name: 'IServiceProvider'. inside DefaultHubDispatcher.OnDisconnectedAsync. The error indicates that the IServiceProvider scope has already been disposed when the disconnect handler tries to resolve a service from it.

    This is a known race condition pattern in SignalR hub disconnect handling: when the test disposes the host/server while a long-polling connection is being torn down, the IServiceProvider for the connection scope is disposed before OnDisconnectedAsync completes. The DefaultHubDispatcher accesses scoped services during disconnect, and if the disposal races with the disconnect callback, this exception can occur.

    The failure is not deterministic — it depends on scheduler timing during test teardown. No product regression is indicated; this is a test infrastructure / teardown sequencing issue that can occur when the host is disposed before the hub lifecycle fully completes.

    Generated by Daily Test Quarantine Management · 5.7K AIC · ⌖ 52 AIC · ⊞ 25.6K · ◷

  2. Youssef1313 commented on Jun 24, 2026

    @Youssef1313
    Member

    @DeagleGross Should the quarantine be reverted now that #65928 got merged?

  3. added
    area-signalr
    on Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-signalrtest-failure

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions