-
Notifications
You must be signed in to change notification settings - Fork 259
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
Simplify HasCorrectTimeout #4042
Simplify HasCorrectTimeout #4042
Conversation
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.
Assigning @nohwnd for review
src/TestFramework/TestFramework/Attributes/TestMethod/TimeoutAttribute.cs
Outdated
Show resolved
Hide resolved
test/UnitTests/MSTestAdapter.UnitTests/Extensions/MethodInfoExtensionsTests.cs
Outdated
Show resolved
Hide resolved
The code looks correct, I've initially added it here, as a replacement for repeated calls to GetAttributes, https://github.com/microsoft/testfx/pull/2839/files which reduced the numbers of calls to reflection (I think we queried the attributes 4 or 5 times to figure out the timeout). And then with further optimizations the code was never called with null as pointed out by this PR. The code where we query the attributes is using the reflection helper methods, so it all should be correct. |
Co-authored-by: Youssef Victor <[email protected]>
it was never called with a null value. so move it to a calculated property on the attribute