GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Remove dependency on DNS for `Test-Connection` tests on macOS by rjmholt · Pull Request #12943 · PowerShell/PowerShell

Conversation

@rjmholt

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

Uh oh!

There was an error while loading. Please reload this page.

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

  • PR has a meaningful title
    • Use the present tense and imperative mood when describing your changes
  • Summarized changes
  • Make sure all .h, .cpp, .cs, .ps1 and .psm1 files have the correct copyright header
  • This PR is ready to merge and is not Work in Progress.
    • If the PR is work in progress, please add the prefix WIP: or [ WIP ] to the beginning of the title (the WIP bot will keep its status check at Pending while the prefix is present) and remove the prefix when the PR is ready.
  • Breaking changes
    • None
    • OR
    • Experimental feature(s) needed
      • Experimental feature name(s):
  • User-facing changes
    • Not Applicable
    • OR
    • Documentation needed
      • Issue filed:
  • Testing - New and feature
    • N/A or can only be tested interactively
    • OR
    • Make sure you've added a new test if existing tests do not effectively test the code changed
  • Tooling
    • I have considered the user experience from a tooling perspective and don't believe tooling will be impacted.
    • OR
    • I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include:
      • Impact on PowerShell Editor Services which is used in the PowerShell extension for VSCode (which runs in a different PS Host).
      • Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features.
      • Impact on PSScriptAnalyzer (which provides linting & formatting in the editor extensions).
      • Impact on EditorSyntax (which provides syntax highlighting with in VSCode, GitHub, and many other editors).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@rjmholt
Add ifconfig fallback for Test-Connection tests on macOS
8b16073
@ghost ghost assigned Andrew (anmenaga) Jun 11, 2020
@rjmholt
Rob Holt (rjmholt) requested review from Steve Lee (SteveL-MSFT), Travis Plunk (TravisEz13), Aditya Patwardhan (adityapatwardhan) and Ilya (iSazonov) and removed request for Aditya Patwardhan (adityapatwardhan) June 11, 2020 18:26
@rjmholt

Rob Holt (rjmholt) commented Jun 11, 2020

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

TravisEz13
Travis Plunk (TravisEz13) approved these changes Jun 11, 2020
View reviewed changes
@rjmholt
Add more hostname resolution information
c5bd701
@rjmholt

Rob Holt (rjmholt) commented Jun 11, 2020

Copy link
Copy Markdown
Collaborator Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vexx32

Rain Sallow (/u/ta11ow) (vexx32) commented Jun 11, 2020

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... 😕

rjmholt reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rjmholt Rob Holt (rjmholt) mentioned this pull request Jun 11, 2020
Dns.GetHostEntry(Dns.GetHostName()) throws ExtendedSocketException when ifconfig succeeds dotnet/runtime#37766
Closed
Rob Holt (rjmholt) added 2 commits June 11, 2020 13:30
@rjmholt
Attempt to display errors
baecb7f
@rjmholt
Try alternate format output
ffb070e
SteveL-MSFT
Steve Lee (SteveL-MSFT) reviewed Jun 12, 2020
View reviewed changes
Comment thread test/powershell/Modules/Microsoft.PowerShell.Management/Test-Connection.Tests.ps1 Outdated

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

@SteveL-MSFT Steve Lee (SteveL-MSFT) Jun 12, 2020

Copy link
Copy Markdown
Member

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.

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vexx32 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@rjmholt
Try hostname | nslookup
5ad31d8
@rjmholt
Rob Holt (rjmholt) marked this pull request as draft June 12, 2020 20:55
@rjmholt

Rob Holt (rjmholt) commented Jun 12, 2020

Copy link
Copy Markdown
Collaborator Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rjmholt Rob Holt (rjmholt) closed this Jun 12, 2020
@rjmholt
Add nslookup test
035ef47
@rjmholt

Rob Holt (rjmholt) commented Jun 12, 2020

Copy link
Copy Markdown
Collaborator Author

Reopening to run something in CI

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rjmholt Rob Holt (rjmholt) reopened this Jun 12, 2020
@rjmholt Rob Holt (rjmholt) mentioned this pull request Jun 12, 2020
macOS instances cannot resolve own hostname through DNS actions/runner-images#1042
Closed
1 of 6 tasks
Rob Holt (rjmholt) added 2 commits June 12, 2020 15:28
@rjmholt
Fix stupid test
97e6858
@rjmholt
Attempt to use Gateway address instead
296d6a2
SteveL-MSFT
Steve Lee (SteveL-MSFT) previously requested changes Jun 12, 2020
View reviewed changes
Comment thread test/powershell/Modules/Microsoft.PowerShell.Management/Test-Connection.Tests.ps1 Resolved

Uh oh!

There was an error while loading. Please reload this page.

@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
@rjmholt
Fix up hostname uses
d4cfaeb
@rjmholt
Rob Holt (rjmholt) requested a review from Paul Higinbotham (PaulHigin) June 16, 2020 02:11
iSazonov
Ilya (iSazonov) reviewed Jun 16, 2020
View reviewed changes
Comment thread test/powershell/Modules/Microsoft.PowerShell.Management/Test-Connection.Tests.ps1 Resolved

Uh oh!

There was an error while loading. Please reload this page.

@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
PaulHigin
Paul Higinbotham (PaulHigin) approved these changes Jun 16, 2020
View reviewed changes
adityapatwardhan
Aditya Patwardhan (adityapatwardhan) requested changes Jun 16, 2020
View reviewed changes
Comment thread test/powershell/Modules/Microsoft.PowerShell.Management/Test-Connection.Tests.ps1 Resolved

Uh oh!

There was an error while loading. Please reload this page.

@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
@rjmholt
Remove ??
e662e99
@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
Aditya Patwardhan (adityapatwardhan) approved these changes Jun 16, 2020
View reviewed changes
iSazonov
Ilya (iSazonov) approved these changes Jun 16, 2020
View reviewed changes
@daxian-dbw Dongbo Wang (daxian-dbw) mentioned this pull request Jun 16, 2020
Remove positional assignment of QUALIFIER for SPLIT-PATH #12960
Merged
8 of 14 tasks
@adityapatwardhan

Aditya Patwardhan (adityapatwardhan) commented Jun 16, 2020

Copy link
Copy Markdown
Member

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

SteveL-MSFT
Steve Lee (SteveL-MSFT) reviewed Jun 16, 2020
View reviewed changes
Comment thread test/powershell/Modules/Microsoft.PowerShell.Management/Test-Connection.Tests.ps1
$gatewayAddress = GetGatewayAddress
$publicHostAddress = GetExternalHostAddress -HostName $hostName

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

@SteveL-MSFT Steve Lee (SteveL-MSFT) Jun 16, 2020

Copy link
Copy Markdown
Member

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.

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@rjmholt Rob Holt (rjmholt) Jun 16, 2020

Copy link
Copy Markdown
Collaborator Author

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.

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@TravisEz13
Travis Plunk (TravisEz13) dismissed Steve Lee (SteveL-MSFT)’s stale review June 16, 2020 19:36

said review was not blocking

@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
@TravisEz13 Travis Plunk (TravisEz13) added this to the 7.1.0-preview.4 milestone Jun 16, 2020
@TravisEz13 Travis Plunk (TravisEz13) assigned Travis Plunk (TravisEz13) and unassigned Andrew (anmenaga) Jun 16, 2020
@ghost

Deleted user (ghost) commented Jun 25, 2020

Copy link
Copy Markdown

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

Handy links:

  • Release Notes
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ghost ghost mentioned this pull request Jun 25, 2020
Test-Connection test setup fails on macOS due to DNS issue #12935
Closed
@TravisEz13 Travis Plunk (TravisEz13) modified the milestones: 7.1.0-preview.4, 7.0.x-Servicing-Consider Jul 14, 2020
@ghost

Deleted user (ghost) commented Jul 16, 2020

Copy link
Copy Markdown

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

Handy links:

  • Release Notes
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rjmholt
Rob Holt (rjmholt) deleted the improve-test-connection-tests branch July 30, 2020 04:33
@rjmholt Rob Holt (rjmholt) mentioned this pull request Jul 31, 2020
Reinstate Test-Connection tests #13324
Merged
7 of 14 tasks
@BrandonBoone Brandon J. Boone (BrandonBoone) mentioned this pull request Aug 4, 2020
Updating PowerShell Core should be simpler #8663
Closed
Travis Plunk (TravisEz13) added a commit that referenced this pull request Sep 9, 2020
@TravisEz13
Merged PR 12007: Remove dependency on DNS for Test-Connection tests…
408dbaf
… on macOS (#12943)
@TravisEz13 Travis Plunk (TravisEz13) mentioned this pull request Oct 12, 2022
Back-port to 7.0: Update list of PowerShell team members in release tools #18266
Merged
22 tasks
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
@rjmholt
Remove dependency on DNS for Test-Connection tests on macOS (PowerS…
added12
…hell#12943)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@SteveL-MSFT Steve Lee (SteveL-MSFT) SteveL-MSFT left review comments
@TravisEz13 Travis Plunk (TravisEz13) TravisEz13 approved these changes
@adityapatwardhan Aditya Patwardhan (adityapatwardhan) adityapatwardhan approved these changes
@iSazonov Ilya (iSazonov) iSazonov approved these changes
+1 more reviewer
@PaulHigin Paul Higinbotham (PaulHigin) PaulHigin approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@TravisEz13 Travis Plunk (TravisEz13)

Labels

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

Projects

None yet

Milestone

7.0.x-Servicing-Consider

Development

Successfully merging this pull request may close these issues.

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

Uh oh!

There was an error while loading. Please reload this page.

8 participants

@rjmholt @vexx32 @adityapatwardhan @TravisEz13 @SteveL-MSFT @PaulHigin @iSazonov @anmenaga
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.