Skip to content

Commit 4517523

Browse files
committed
Linux lib has a different timeout message
1 parent 2554b94 commit 4517523

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/oracle/Invoke-DBOQuery.Tests.ps1

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,11 @@ Describe "Invoke-DBOQuery Oracle tests" -Tag $commandName, IntegrationTests {
153153
}
154154
It "should throw a connection timeout error" {
155155
$query = "SELECT 1/0 FROM DUAL"
156-
try { $null = Invoke-DBOQuery -Type Oracle -Query $query -SqlInstance localhost:6493 -Credential $script:oracleCredential -ConnectionTimeout 1 }
157-
catch { $errVar = $_ }
158-
$errVar.Exception.Message | Should -Match "Connection request timed out"
156+
$message = switch ($IsWindows) {
157+
$false { 'Network Transport: TCP transport address connect failure' }
158+
default { "Connection request timed out" }
159+
}
160+
{ $null = Invoke-DBOQuery -Type Oracle -Query $query -SqlInstance localhost:6493 -Credential $script:oracleCredential -ConnectionTimeout 1 } | Should throw $message
159161
}
160162
It "should fail when credentials are wrong" {
161163
try { Invoke-DBOQuery -Type Oracle -Query 'SELECT 1 FROM DUAL' -SqlInstance $script:oracleInstance -Credential ([pscredential]::new('nontexistent', ([securestring]::new()))) }

0 commit comments

Comments
 (0)