Skip to content

Commit 3349a4b

Browse files
committed
fixing timeouts
1 parent c8b6eb9 commit 3349a4b

4 files changed

Lines changed: 12 additions & 5 deletions

File tree

tests/functional/Install-DBOPackage.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ Describe "<type> Install-DBOPackage integration tests" -Tag FunctionalTests -For
212212
$testResults.Scripts.Name | Should -Be '1.0\delay.sql'
213213
$testResults.SourcePath | Should -Be (Join-PSFPath -Normalize "$workFolder\delay.zip")
214214
$testResults.Error | Should -BeNullOrEmpty
215-
$testResults.Duration.TotalMilliseconds | Should -BeGreaterThan 3000
215+
$testResults.Duration.TotalMilliseconds | Should -BeGreaterThan 2500
216216

217217
$output = Get-Content "$workFolder\log.txt" -Raw
218218
$output | Should -Not -BeLike $timeoutError

tests/functional/Install-DBOScript.Tests.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ Describe "<type> Install-DBOScript integration tests" -Tag FunctionalTests -ForE
127127
$testResults.Scripts.Name | Should -Be (Get-Item $delayScript).Name
128128
$testResults.SourcePath | Should -Be (Resolve-Path $delayScript).Path
129129
$testResults.Error | Should -BeNullOrEmpty
130-
$testResults.Duration.TotalMilliseconds | Should -BeGreaterThan 3000
130+
$testResults.Duration.TotalMilliseconds | Should -BeGreaterThan 2500
131131
$output = Get-Content $outputFile -Raw
132132
$output | Should -Not -BeLike $timeoutError
133133
$output | Should -BeLike '*Successful!*'
@@ -138,7 +138,7 @@ Describe "<type> Install-DBOScript integration tests" -Tag FunctionalTests -ForE
138138
$testResults.Scripts.Name | Should -Be (Get-Item $delayScript).Name
139139
$testResults.SourcePath | Should -Be (Resolve-Path $delayScript).Path
140140
$testResults.Error | Should -BeNullOrEmpty
141-
$testResults.Duration.TotalMilliseconds | Should -BeGreaterThan 3000
141+
$testResults.Duration.TotalMilliseconds | Should -BeGreaterThan 2500
142142
$output = Get-Content $outputFile -Raw
143143
$output | Should -Not -BeLike $timeoutError
144144
$output | Should -BeLike '*Successful!*'

tests/functional/Invoke-Deployment.Tests.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Describe "<type> Invoke-Deployment integration tests" -Tag FunctionalTests -ForE
128128
$testResults.Scripts.Name | Should -Be (Get-Item $delayScript).Name
129129
$testResults.SourcePath | Should -Be (Resolve-Path $delayScript).Path
130130
$testResults.Error | Should -BeNullOrEmpty
131-
$testResults.Duration.TotalMilliseconds | Should -BeGreaterThan 3000
131+
$testResults.Duration.TotalMilliseconds | Should -BeGreaterThan 2500
132132
$output = Get-Content $outputFile -Raw
133133
$output | Should -Not -BeLike $timeoutError
134134
$output | Should -BeLike '*Successful!*'
@@ -140,7 +140,7 @@ Describe "<type> Invoke-Deployment integration tests" -Tag FunctionalTests -ForE
140140
$testResults.Scripts.Name | Should -Be (Get-Item $delayScript).Name
141141
$testResults.SourcePath | Should -Be (Resolve-Path $delayScript).Path
142142
$testResults.Error | Should -BeNullOrEmpty
143-
$testResults.Duration.TotalMilliseconds | Should -BeGreaterThan 3000
143+
$testResults.Duration.TotalMilliseconds | Should -BeGreaterThan 2500
144144
$output = Get-Content $outputFile -Raw
145145
$output | Should -Not -BeLike $timeoutError
146146
$output | Should -BeLike '*Successful!*'

tests/functional/fixtures.ps1

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ CREATE TABLE "$logtable"
159159
GRANT CONNECT, RESOURCE, CREATE ANY TABLE TO $dbUserName/
160160
GRANT EXECUTE on dbms_lock to $dbUserName"
161161
$dropDatabaseScript = "
162+
DECLARE
163+
sescount int;
162164
BEGIN
163165
FOR x IN ( SELECT count(*) cnt
164166
FROM DUAL
@@ -171,6 +173,11 @@ CREATE TABLE "$logtable"
171173
LOOP
172174
EXECUTE IMMEDIATE ('ALTER SYSTEM DISCONNECT SESSION ''' || ln_cur.sid || ',' || ln_cur.serial# || ''' IMMEDIATE');
173175
END LOOP;
176+
LOOP
177+
SELECT COUNT(*) INTO sescount FROM v`$session WHERE username = '$dbUserName';
178+
EXIT WHEN sescount = 0;
179+
DBMS_LOCK.sleep(0.1);
180+
END LOOP;
174181
EXECUTE IMMEDIATE 'DROP USER $dbUserName CASCADE';
175182
END IF;
176183
END LOOP;

0 commit comments

Comments
 (0)