-
Notifications
You must be signed in to change notification settings - Fork 10k
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
Clean up async timeout extension methods #31671
Conversation
These failing tests seems to fail even on main branch for me. Do you have any suggestions? |
Enabling target .net6.0 for AspNetCore Testing project
399b557
to
04f0210
Compare
@@ -20,6 +20,7 @@ | |||
<Reference Include="Microsoft.AspNetCore.SignalR.Protocols.Json" /> | |||
<Reference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" /> | |||
<Reference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" /> | |||
<Reference Include="Microsoft.AspNetCore.Testing" /> |
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 one's a problem, Microsoft.AspNetCore.SignalR.Specification.Tests is actually a shipping package, not a test. It can't depend on Microsoft.AspNetCore.Testing which is not a shipping package.
https://www.nuget.org/packages/Microsoft.AspNetCore.SignalR.Specification.Tests
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.
Right, this one can't use any test helpers.
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 will double check this one.
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.
Both HubLifetimeManagerTestBase
and ScaleoutHubLifetimeManagerTests
uses DefaultTimeout heavily. Which makes me move TaskExtensions from Microsoft.AspNetCore.Testing to \Shared folder to reference the file directly to resolve this issue.
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 gets a little more tricky in TestClient.cs to make it compile everywhere, I have to use compiler conditions in the using statements.
src/Testing/src/TaskExtensions.cs
Outdated
@@ -23,7 +68,16 @@ public static class TaskExtensions | |||
{ | |||
return await task; | |||
} | |||
|
|||
#if NET6_0 |
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.
Everywhere:
#if NET6_0 | |
#if NET6_0_OR_GREATER |
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.
ack, will update
Thanks for the PR! It will be good to have consistent timeout methods across the repo. |
Solid work @ladeak! |
cc @stephentoub |
Nice. Thanks. |
Hi @stephentoub. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context. |
Clean up async timeout extension methods
Addresses #16620