-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Plumb a clock interface through SignalR for testing #19311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
{ | ||
_logger = loggerFactory.CreateLogger<HttpConnectionManager>(); | ||
_connectionLogger = loggerFactory.CreateLogger<HttpConnectionContext>(); | ||
_nextHeartbeat = new TimerAwaitable(_heartbeatTickRate, _heartbeatTickRate); | ||
_disconnectTimeout = connectionOptions.Value.DisconnectTimeout ?? ConnectionOptionsSetup.DefaultDisconectTimeout; | ||
if (AppContext.TryGetSwitch("Microsoft.AspNetCore.Http.Connections.DoNotUseSendTimeout", out var timeoutDisabled)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove the switch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was only for patch branches
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we do this in other places too. Like MVC
|
||
namespace Microsoft.AspNetCore.Internal | ||
{ | ||
internal interface ISystemClock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we share this stuff with Kestrel?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably, I did just copy it from Kestrel.
src/SignalR/common/Http.Connections/src/Internal/HttpConnectionManager.cs
Outdated
Show resolved
Hide resolved
@@ -223,8 +223,6 @@ private async Task DispatchMessagesAsync(HubConnectionContext connection) | |||
var result = await input.ReadAsync(); | |||
var buffer = result.Buffer; | |||
|
|||
connection.ResetClientTimeout(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
? This moved?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's no longer needed with how we changed timeouts
9bd96ee
to
c68eadf
Compare
Ok, fixed this to be scoped to just HubConnectionHandler and set it in tests that want to control the clock. |
Task.Delay(...)
Not very happy with the compile includes, but didn't want to do internals visible to, or design a new public type.