Skip to content

Test-DbaLinkedServerConnection - Test failed if named pipe is not enabled #10324

@andreasjordan

Description

@andreasjordan

Verified issue does not already exist?

I have searched and found no existing issue

What error did you receive?

When running the test in my lab I get:

Running tests from 'C:\GitHub\dbatools\tests\Test-DbaLinkedServerConnection.Tests.ps1'
Describing Test-DbaLinkedServerConnection
 Context Parameter validation
   [+] Should have the expected parameters 12ms (2ms|10ms)

Describing Test-DbaLinkedServerConnection
 Context Function works
   [+] function returns results 22ms (1ms|21ms)
   [+] linked server name is correct 1ms (1ms|1ms)
   [-] connectivity is true 4ms (3ms|1ms)
    Expected strings to be the same, but they were different.
    Expected length: 7
    Actual length:   548
    Strings differ at index 0.
    Expected: 'Success'
    But was:  'Named Pipes Provider: Could not open a connection to SQL Server [2]. \r\nOLE DB provider "MSOLEDBSQL" for linked server "SQL03\SQL2022" returned message "Login timeout expired".\r\nOLE DB ...'
               ^
    at $results.Result | Should -Be 'Success', C:\GitHub\dbatools\tests\Test-DbaLinkedServerConnection.Tests.ps1:68
    at <ScriptBlock>, C:\GitHub\dbatools\tests\Test-DbaLinkedServerConnection.Tests.ps1:68
 Context Piping to function works
   [+] piping from Get-DbaLinkedServerConnection returns results 5ms (2ms|3ms)
   [+] linked server name is correct 2ms (1ms|1ms)
   [-] connectivity is true 3ms (2ms|1ms)
    Expected strings to be the same, but they were different.
    Expected length: 7
    Actual length:   548
    Strings differ at index 0.
    Expected: 'Success'
    But was:  'Named Pipes Provider: Could not open a connection to SQL Server [2]. \r\nOLE DB provider "MSOLEDBSQL" for linked server "SQL03\SQL2022" returned message "Login timeout expired".\r\nOLE DB ...'
               ^
    at $pipeResults.Result | Should -Be 'Success', C:\GitHub\dbatools\tests\Test-DbaLinkedServerConnection.Tests.ps1:87
    at <ScriptBlock>, C:\GitHub\dbatools\tests\Test-DbaLinkedServerConnection.Tests.ps1:87
Tests completed in 23.66s
Tests Passed: 5, Failed: 2, Skipped: 0, Inconclusive: 0, NotRun: 0

Steps to Reproduce

Just run the test.

Please confirm that you are running the most recent version of dbatools

current dev branch

Other details or mentions

No response

What PowerShell host was used when producing this error

Windows PowerShell (powershell.exe)

PowerShell Host Version

SQL Server Edition and Build number

All current versions

.NET Framework Version

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugs lifetriage requiredNew issue that has not been reviewed by maintainers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions