Skip to content

Remove dependency on DNS for Test-Connection tests on macOS - #12943

Merged
Travis Plunk (TravisEz13) merged 19 commits into
PowerShell:masterfrom
rjmholt:improve-test-connection-tests
Jun 16, 2020
Merged

Travis Plunk (TravisEz13) merged 19 commits into
PowerShell:masterfrom
rjmholt:improve-test-connection-tests

Conversation

@rjmholt

@rjmholt Rob Holt (rjmholt) commented Jun 11, 2020 •

Copy link
Copy Markdown
Collaborator

PR Summary

Fixes #12935.

macOS has had issues with DNS in CI, so this PR falls back to using the gateway address when DNS doesn't work.

Using the gateway address doesn't seem to work well on other platforms though, so we still try DNS lookup.

PR Checklist

@rjmholt

Copy link
Copy Markdown
Collaborator Author

From CI, it seems that solving the setup issue kicks the can down to a test failure instead where Test-Connection falls over

@rjmholt

Copy link
Copy Markdown
Collaborator Author

From the CI, it looks like ifconfig is able to resolve the address properly

@vexx32

Copy link
Copy Markdown
Collaborator

Rob Holt (@rjmholt) the cmdlet uses the system.net.dns APIs internally quite a bit, so I'd imagine if those APIs themselves are failing it'll most likely fall apart in at least a couple of cases.

Definitely seems like something changed that the .NET Core folks will need to take a look at... 😕


if (-not $?)
{
Get-Error | Out-String | Write-Host

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to use -Because with the first Should test to have this in the test log?

@rjmholt
Rob Holt (rjmholt) marked this pull request as draft June 12, 2020 20:55
@rjmholt

Copy link
Copy Markdown
Collaborator Author

Ok the latest change proves that this is a CI configuration issue rather than a .NET issue

@rjmholt

Copy link
Copy Markdown
Collaborator Author

Reopening to run something in CI

@ghost ghost added the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Jun 12, 2020
@iSazonov Ilya (iSazonov) added the CL-Test Indicates that a PR should be marked as a test change in the Change Log label Jun 16, 2020
@ghost ghost added the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Jun 16, 2020
@ghost ghost removed the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Jun 16, 2020
@adityapatwardhan

Copy link
Copy Markdown
Member

Steve Lee (@SteveL-MSFT) Please update your review

$gatewayAddress = GetGatewayAddress
$publicHostAddress = GetExternalHostAddress -HostName $hostName

$testAddress = if ($publicHostAddress) { $publicHostAddress } else { $gatewayAddress }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not blocking, but could have used the null conditional assignment operator here

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to port back to 6.2 -- deliberately removed new operators in most recent commit

@TravisEz13 Travis Plunk (TravisEz13) changed the title Remove dependency on DNS for Test-Connection tests on macOS Remove dependency on DNS for Test-Connection tests on macOS Jun 16, 2020
@TravisEz13
Travis Plunk (TravisEz13) merged commit a650709 into PowerShell:master Jun 16, 2020
@ghost

Copy link
Copy Markdown

🎉v7.1.0-preview.4 has been released which incorporates this pull request.:tada:

Handy links:

@ghost

Copy link
Copy Markdown

🎉v7.0.3 has been released which incorporates this pull request.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-Test Indicates that a PR should be marked as a test change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test-Connection test setup fails on macOS due to DNS issue

8 participants