Skip to content
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

Fix Http2Connection.GetIdleTicks #55820

Merged
merged 1 commit into from
Jul 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1697,7 +1697,7 @@ public override long GetIdleTicks(long nowTicks)
{
lock (SyncObject)
{
return _streamsInUse == 0 ? _idleSinceTickCount - nowTicks : 0;
return _streamsInUse == 0 ? nowTicks - _idleSinceTickCount : 0;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2214,7 +2214,6 @@ public async Task Http2_MultipleConnectionsEnabled_OpenAndCloseMultipleConnectio

[ConditionalFact(nameof(SupportsAlpn))]
[OuterLoop("Incurs long delay")]
[ActiveIssue("https://github.com/dotnet/runtime/issues/43877")]
public async Task Http2_MultipleConnectionsEnabled_IdleConnectionTimeoutExpired_ConnectionRemovedAndNewCreated()
{
const int MaxConcurrentStreams = 2;
Expand Down Expand Up @@ -2244,15 +2243,6 @@ public async Task Http2_MultipleConnectionsEnabled_IdleConnectionTimeoutExpired_

// Wait until the idle connection timeout expires.
await connection1.WaitForClientDisconnectAsync(false).WaitAsync(TestHelper.PassingTestTimeout).ConfigureAwait(false);
// Client connection might be still alive, so send an extra request which will either land on the shutting down connection or on a new one.
try
{
await client.GetAsync(server.Address).WaitAsync(handler.PooledConnectionIdleTimeout).ConfigureAwait(false);
}
catch (Exception)
{
// Suppress all exceptions.
}

Assert.True(connection1.IsInvalid);
Assert.False(connection0.IsInvalid);
Expand Down