mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Added a missing ConfigureAwait(false) call (#20606)
This commit is contained in:
@@ -4600,3 +4600,34 @@ Describe 'Invoke-WebRequest and Invoke-RestMethod support OperationTimeoutSecond
|
||||
RunWithNetworkTimeout -Command Invoke-RestMethod -Uri $uri -OperationTimeoutSeconds 2 -WillTimeout -Arguments '-SkipCertificateCheck'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Describe "Invoke-RestMethod should run in the default synchronization context (threadpool)" -Tag "CI" {
|
||||
BeforeAll {
|
||||
$oldProgress = $ProgressPreference
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
$WebListener = Start-WebListener
|
||||
}
|
||||
|
||||
AfterAll {
|
||||
$ProgressPreference = $oldProgress
|
||||
}
|
||||
|
||||
It "Invoke-RestMethod works after constructing a WindowsForm object" -Skip:(!$IsWindows) {
|
||||
$env:URI_TO_TEST = Get-WebListenerUrl -Test 'Get'
|
||||
$irmResult = $null
|
||||
try {
|
||||
$pwsh = Join-Path $PSHOME "pwsh"
|
||||
$irmResult = & $pwsh -NoProfile {
|
||||
Add-Type -AssemblyName System.Windows.Forms
|
||||
$null = New-Object System.Windows.Forms.Form
|
||||
Invoke-RestMethod $env:URI_TO_TEST
|
||||
}
|
||||
} finally {
|
||||
$env:URI_TO_TEST = $null
|
||||
}
|
||||
|
||||
# Simply making it this far is good enough to ensure we didn't hit a deadlock
|
||||
$irmResult | Should -Not -BeNullOrEmpty
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user