-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Cleanup the Polly
and Polly.Specs
codebase
#1290
Comments
Co-authored-by: Martin Costello <[email protected]>
Hi👋I would like to help with this issue |
@davidCett Thanks for volunteering! Feel free to open a pull request to tackle one of the disabled warnings. I suggest you tackle one or two per pull request to prevent the diffs getting too big to easily review. |
💡 Tips for future contributors working on this issue:
|
For the warnings xUnit1031, it says blocking calls should not be used in a test method. The below mentioned code uses Task.WaitAll which is a blocking action. Example : #pragma warning disable xUnit1031 // Do not use blocking task operations in test method
Task.WaitAll([firstExecution, secondExecution], testTimeoutToExposeDeadlocks).Should().BeTrue();
#pragma warning restore xUnit1031 // Do not use blocking task operations in test method The essence of the above lines is to check if firstExecution and secondExecution tasks finishes before the specified timeout (testTimeoutToExposeDeadlocks). I want to confirm if the below mentioned non-blocking code can be a proper replacement for the above code. var allTasksTask = Task.WhenAll(firstExecution, secondExecution);
var completedTask = await Task.WhenAny(allTasksTask, Task.Delay(testTimeoutToExposeDeadlocks));
(completedTask == allTasksTask).Should().BeTrue(); |
If I remember correctly, these tests are specifically testing synchronous code paths, so the suppressions should be left in place. |
In the #1287 we enabled a full set of analyzers for these projects. Many of the rules are currently suppressed in each respective
csproj
file with the<NoWarn>
element.We can enable these rules one-be-one and cleanup the codebase.
The text was updated successfully, but these errors were encountered: