-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
Conversation
I'm explicitly ignoring the code factor issues |
@@ -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
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.
Sorry for the delay of getting back to this. Yes, saving the object in the error and checking the error in the test would be a better approach, as that won't change the intention of the method.
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.
29ce422
to
eb99667
Compare
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.
LGTM
📣 Hey @JamesWTruher, how did we do? We would love to hear your feedback with the link below! 🗣️ 🔗 https://aka.ms/PSRepoFeedback |
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).