You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Quarantine TestServerTests.LongPollingWorks (ObjectDisposedException in DefaultHubDispatcher) #67348
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.
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.
Activity
github-actions commentedon Jun 21, 2026
Investigation
The test fails with
System.ObjectDisposedException: Cannot access a disposed object. Object name: 'IServiceProvider'.insideDefaultHubDispatcher.OnDisconnectedAsync. The error indicates that theIServiceProviderscope 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
IServiceProviderfor the connection scope is disposed beforeOnDisconnectedAsynccompletes. TheDefaultHubDispatcheraccesses 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.
Fix test-quarantine unquarantine matching and re-quarantine detection (…
Youssef1313 commentedon Jun 24, 2026
@DeagleGross Should the quarantine be reverted now that #65928 got merged?