Skip to content

Quarantine RedisHubLifetimeManagerTests.ClientDisconnectsWithoutCompletingClientResultOnSecondServer failing intermittently #65855

Open

Description

@github-actions

Failing Test(s)

Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests.RedisHubLifetimeManagerTests.ClientDisconnectsWithoutCompletingClientResultOnSecondServer

Error Message

Assert.Throws() Failure: Exception type was not an exact match
Expected: typeof(Microsoft.AspNetCore.SignalR.HubException)
Actual:   typeof(System.IO.IOException)

Stacktrace

Details
Assert.Throws() Failure: Exception type was not an exact match
Expected: typeof(Microsoft.AspNetCore.SignalR.HubException)
Actual:   typeof(System.IO.IOException)
   at Xunit.Assert.Throws[T](Func`1 testCode)
   at Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests.RedisHubLifetimeManagerTests.ClientDisconnectsWithoutCompletingClientResultOnSecondServer()

Logs

Details
See build logs for detailed output. When a client disconnects while a client result is pending on the second server, the test expects a HubException but intermittently gets an IOException instead.

Build

https://dev.azure.com/dnceng-public/public/_build/results?buildId=1333947

Generated by Daily Test Quarantine Management · ◷

Activity

  1. github-actions commented on Mar 18, 2026

    @github-actions
    ContributorAuthor

    Investigation

    The test ClientDisconnectsWithoutCompletingClientResultOnSecondServer intermittently fails because the actual exception thrown is System.IO.IOException instead of the expected Microsoft.AspNetCore.SignalR.HubException.

    Root cause: This is a race condition in the Redis backplane client result handling when a client disconnects unexpectedly on a second server. The test:

    1. Invokes a client result from server2 to client1 (connected to server1)
    2. Disconnects client1 before the result is completed
    3. Expects a HubException indicating the client disconnected

    When the Redis connection between the two servers drops or when the cleanup races with the client result wait, the SignalR infrastructure may throw an IOException (from the underlying Redis connection or stream) instead of wrapping it in a HubException.

    The fix would be to ensure that when a client disconnects mid-client-result-invocation, all network-level exceptions from the Redis backplane are caught and wrapped in a HubException before propagating to the caller.

    Quarantine PR: The test is being quarantined to unblock CI while the exception wrapping issue is investigated.

    Generated by Daily Test Quarantine Management · ◷

  2. github-actions commented on Mar 27, 2026

    @github-actions
    ContributorAuthor

    Investigation

    The test ClientDisconnectsWithoutCompletingClientResultOnSecondServer intermittently fails with:

    Assert.Throws() Failure: Exception type was not an exact match
    Expected: typeof(Microsoft.AspNetCore.SignalR.HubException)
    Actual:   typeof(System.IO.IOException)
    ---- System.IO.IOException : Connection '0e9a7dbd-bed3-4098-ad6f-cc14559a158e' does not exist.
    

    Root cause: There is a race condition in RedisHubLifetimeManager.InvokeConnectionAsync (RedisHubLifetimeManager.cs:403). The test:

    1. Has client1 connected to server1/manager2
    2. Invokes a client result from manager1 to connection1 (cross-server via Redis)
    3. Disconnects client1 before the result is received

    When the timing is tight between the disconnect propagation and the Redis invocation, InvokeConnectionAsync throws a System.IO.IOException ("Connection does not exist") directly from the Redis layer rather than the expected HubException. The fix would be to ensure that InvokeConnectionAsync wraps or rethrows IOException as HubException consistently when the connection no longer exists.

    This test is being quarantined while the fix is investigated.

    Note

    🔒 Integrity filter blocked 9 items

    The following items were blocked because they don't meet the GitHub integrity level.

    To allow these resources, lower min-integrity in your GitHub frontmatter:

    tools:
      github:
        min-integrity: approved  # merged | approved | unapproved | none

    Generated by Daily Test Quarantine Management · ◷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions