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
Add debugging to MTUSize test. #21463
base: master
Are you sure you want to change the base?
Conversation
Also be sure to include the reply in more conditions. Fix up os version for Mac in get-platforminfo.
Use the proper parameter when getting macOS product version.
I'm explicitly ignoring the code factor issues |
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
@@ -585,6 +585,7 @@ private void ProcessMTUSize(string targetNameOrAddress) | |||
if (reply.Status == IPStatus.PacketTooBig || reply.Status == IPStatus.TimedOut) | |||
{ | |||
HighMTUSize = CurrentMTUSize; | |||
replyResult = reply; |
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.
looks like you now set replyResult = reply
in each condition, so why not just have it set before the if
statement?
@@ -614,6 +615,7 @@ private void ProcessMTUSize(string targetNameOrAddress) | |||
else | |||
{ | |||
retry++; | |||
replyResult = reply; |
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.
By looking at the code, it seems to me replyResult
should only be assigned when reply.Status == IPStatus.Success
. When not, the algorithm retries -- if it's still not successful after exceeding the maximum retries, it writes out error and returns (see code here) -- so it will not call WriteObject
when reply.Status
is not Success
.
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.
@daxian-dbw - this is the reason that the test is flaky. Without returning the reply we cannot determine if the request has timed out. That's why I'm adding it under all these circumstances.
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 suppose i could add the reply as the target object of the error, save the error in the test (via -ErrorVariable
) and then check in that case
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
Also be sure to include the reply in more conditions.
Fix up os version for Mac in get-platforminfo.
PR Summary
PR Context
The MTUSize test is somewhat flakey.
This hopes to improve that.
PR Checklist
.h
,.cpp
,.cs
,.ps1
and.psm1
files have the correct copyright headerWIP:
or[ WIP ]
to the beginning of the title (theWIP
bot will keep its status check atPending
while the prefix is present) and remove the prefix when the PR is ready.(which runs in a different PS Host).