Skip to content

Commit 6f72a0b

Browse files
set rest timeout to 60 seconds
1 parent f350dda commit 6f72a0b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Tasks/QuickPerfTest/Invoke-QuickPerfTest.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ param
2525

2626
$userAgent = "QuickPerfTestBuildTask"
2727

28+
$global:RestTimeout = 60
29+
2830
function InitializeRestHeaders()
2931
{
3032
$restHeaders = New-Object -TypeName "System.Collections.Generic.Dictionary[[String], [String]]"
@@ -72,7 +74,7 @@ function CreateTestDrop($headers, $dropJson)
7274
function GetTestDrop($headers, $drop)
7375
{
7476
$uri = [String]::Format("{0}/_apis/clt/testdrops/{1}?api-version=1.0", $CltAccountUrl, $drop.id)
75-
$testdrop = Invoke-RestMethod -ContentType "application/json" -UserAgent $userAgent -Uri $uri -Headers $headers
77+
$testdrop = Invoke-RestMethod -ContentType "application/json" -UserAgent $userAgent -TimeoutSec $global:RestTimeout -Uri $uri -Headers $headers
7678

7779
return $testdrop
7880
}
@@ -89,7 +91,7 @@ function UploadTestDrop($testdrop)
8991
function GetTestRuns($headers)
9092
{
9193
$uri = [String]::Format("{0}/_apis/clt/testruns?api-version=1.0", $CltAccountUrl)
92-
$runs = Invoke-RestMethod -ContentType "application/json" -UserAgent $userAgent -Uri $uri -Headers $headers
94+
$runs = Invoke-RestMethod -ContentType "application/json" -UserAgent $userAgent -TimeoutSec $global:RestTimeout -Uri $uri -Headers $headers
9395

9496
return $runs
9597
}

0 commit comments

Comments
 (0)