Skip to content

Commit aa0fef0

Browse files
mmitcheCopilot
andcommitted
Make SignalR ping test count sent responses
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 9469ea1 commit aa0fef0

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎src/SignalR/server/SignalR/test/Microsoft.AspNetCore.SignalR.Tests/HubConnectionHandlerTests.cs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2800,9 +2800,11 @@ public async Task DoesNotWritePingMessagesIfSufficientOtherMessagesAreSent()
28002800

28012801
// Echo a bunch of stuff, waiting 10ms between each, until 500ms have elapsed
28022802
var start = DateTime.UtcNow;
2803+
var sentCount = 0;
28032804
while ((DateTime.UtcNow - start).TotalMilliseconds <= 500.0)
28042805
{
28052806
await client.SendInvocationAsync("Echo", "foo").DefaultTimeout();
2807+
sentCount++;
28062808
await Task.Delay(10);
28072809
}
28082810

@@ -2821,7 +2823,7 @@ public async Task DoesNotWritePingMessagesIfSufficientOtherMessagesAreSent()
28212823
counter += 1;
28222824
Assert.IsNotType<PingMessage>(message);
28232825
}
2824-
Assert.InRange(counter, 1, 50);
2826+
Assert.Equal(sentCount, counter);
28252827
}
28262828
}
28272829
}

0 commit comments

Comments
 (0)