You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Test-Connection test setup fails on macOS due to DNS issue #12935
Describing Test-Connection
[-] Error occurred in Describe block 0ms
ExtendedSocketException: nodename nor servname provided, or not known
MethodInvocationException: Exception calling "GetHostEntry" with "1" argument(s): "nodename nor servname provided, or not known"
at <ScriptBlock>, /Users/runner/runners/2.170.1/work/1/s/test/powershell/Modules/Microsoft.PowerShell.Management/Test-Connection.Tests.ps1: line 15
at Invoke-Blocks, /Users/runner/runners/2.170.1/work/1/a/bins/publish/Modules/Pester/4.10.1/Functions/SetupTeardown.ps1: line 135
at Invoke-TestGroupSetupBlocks, /Users/runner/runners/2.170.1/work/1/a/bins/publish/Modules/Pester/4.10.1/Functions/SetupTeardown.ps1: line 121
at DescribeImpl, /Users/runner/runners/2.170.1/work/1/a/bins/publish/Modules/Pester/4.10.1/Functions/Describe.ps1: line 209
I don't know enough about these tests or networking configuration to be a good judge of whether we should try to fix this or how, but want to discuss here if possible.
In particular:
Is this something we think we could fix or workaround in our code? The Test-Connection tests on macOS seem to have been flaky for some time.
Do we think there's some way we could improve the way the CI instance is configured to mitigate?
Otherwise, is there some other way we could perform test setup here that wouldn't hit this issue? Or possibly we could identify when we've hit this issue and handle it somehow?
I don't have high hopes for this. There are tons of issues with the cmdlet on both MacOS and Linux, mainly because the basic .NET API for pings and just pretty much everything is... incomplete at best, and completely broken in some cases. (Try running a trace on Unix with the cmdlet; 99% of the data is unusable.) I filed an issue on the main ones that bothered me as I was (re)writing parts of the cmdlet last time around, and it's been largely ignored.
At best, it looks like the .NET team don't have the more barebones networking APIs high on the priority list.
Test is passing again for now. We have an issue at least now that we can refer back to. I'll close it for now, since it seems like there's not much we can do. But if repeated test failures prove to be a problem, we should consider making these tests -Pending
Is not very specific and $hostName = [System.Net.Dns]::GetHostName() should not really rely on a DNS server. I'm certain on my machine that it does not.
I would consider marking the test as pending if it fails a lot.
This is in a describe block, so pending the tests is not enough.
I don't know enough about these tests or networking configuration to be a good judge of whether we should try to fix this or how, but want to discuss here if possible.
I invite further discussion by any who are more familiar with the functionality here
We have a tracking issue here and in .Net Runtime repository. Can PowerShell team ping .Net team to fix the API? It is absolutely impossible to use the API on Unix-s for years. If they can not fix in .Net 5.0 maybe we switch to an alternative library to get Test-Connection working on Unix-s?
Activity
vexx32 commentedon Jun 10, 2020
I don't have high hopes for this. There are tons of issues with the cmdlet on both MacOS and Linux, mainly because the basic .NET API for pings and just pretty much everything is... incomplete at best, and completely broken in some cases. (Try running a trace on Unix with the cmdlet; 99% of the data is unusable.) I filed an issue on the main ones that bothered me as I was (re)writing parts of the cmdlet last time around, and it's been largely ignored.
At best, it looks like the .NET team don't have the more barebones networking APIs high on the priority list.
adityapatwardhan commentedon Jun 10, 2020
I would consider marking the test as pending if it fails a lot.
rjmholt commentedon Jun 10, 2020
Test is passing again for now. We have an issue at least now that we can refer back to. I'll close it for now, since it seems like there's not much we can do. But if repeated test failures prove to be a problem, we should consider making these tests
-PendingTravisEz13 commentedon Jun 10, 2020
Is not very specific and
$hostName = [System.Net.Dns]::GetHostName()should not really rely on a DNS server. I'm certain on my machine that it does not.This is in a describe block, so pending the tests is not enough.
rjmholt commentedon Jun 10, 2020
See:
I invite further discussion by any who are more familiar with the functionality here
iSazonov commentedon Jun 11, 2020
We have a tracking issue here and in .Net Runtime repository. Can PowerShell team ping .Net team to fix the API? It is absolutely impossible to use the API on Unix-s for years. If they can not fix in .Net 5.0 maybe we switch to an alternative library to get Test-Connection working on Unix-s?
rjmholt commentedon Jun 11, 2020
Looks like this is continuing to occur
rjmholt commentedon Jun 11, 2020
Relevant code:
PowerShell/test/powershell/Modules/Microsoft.PowerShell.Management/Test-Connection.Tests.ps1
Lines 8 to 15 in ec20043
iSazonov commentedon Jun 11, 2020
Maybe MacOS image was updated?
6 remaining items
rjmholt commentedon Jun 12, 2020
Testing in my PR indicates that
nslookupalso fails on macOS, meaning this issue is external to macOSrjmholt commentedon Jun 12, 2020
Opened actions/runner-images#1042
iSazonov commentedon Jun 17, 2020
Will we track actions/runner-images#1042 here?