From a5ab7a87f850d4ba6b0968937cd510f57d2cb554 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Fri, 1 Dec 2017 08:58:52 -0800 Subject: [PATCH 1/3] Disable Requisiste URLs tests --- test/powershell/Installer/WindowsInstaller.Tests.ps1 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/powershell/Installer/WindowsInstaller.Tests.ps1 b/test/powershell/Installer/WindowsInstaller.Tests.ps1 index 759869784a5..a59d8f1d2ed 100644 --- a/test/powershell/Installer/WindowsInstaller.Tests.ps1 +++ b/test/powershell/Installer/WindowsInstaller.Tests.ps1 @@ -15,10 +15,11 @@ Describe "Windows Installer" -Tags "Scenario" { (Get-Content $wixProductFile -Raw).Contains($preRequisitesLink) | Should Be $true } - It "Pre-Requisistes link for '' is reachable: " -TestCases $linkCheckTestCases -Test { + ## Running 'Invoke-WebRequest' with WMF download URLs has been failing intermittently, + ## because sometimes the URLs lead to a 'this download is no longer available' page. + ## Therefore, this test is disabled for now. + It "Pre-Requisistes link for '' is reachable: " -TestCases $linkCheckTestCases -Skip { param ($Url) - - # Because an outdated link 'https://www.microsoft.com/download/details.aspx?id=504100000' would still return a 200 reponse (due to a redirection to an error page), it only checks that it returns something (Invoke-WebRequest $Url -UseBasicParsing) | Should Not Be $null } } From 00552df550d6b2205073add542b06d3a4b72f23e Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Fri, 1 Dec 2017 17:18:01 -0800 Subject: [PATCH 2/3] Add retry for the URL tests --- .../Installer/WindowsInstaller.Tests.ps1 | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/test/powershell/Installer/WindowsInstaller.Tests.ps1 b/test/powershell/Installer/WindowsInstaller.Tests.ps1 index a59d8f1d2ed..a81cca46e37 100644 --- a/test/powershell/Installer/WindowsInstaller.Tests.ps1 +++ b/test/powershell/Installer/WindowsInstaller.Tests.ps1 @@ -18,8 +18,18 @@ Describe "Windows Installer" -Tags "Scenario" { ## Running 'Invoke-WebRequest' with WMF download URLs has been failing intermittently, ## because sometimes the URLs lead to a 'this download is no longer available' page. ## Therefore, this test is disabled for now. - It "Pre-Requisistes link for '' is reachable: " -TestCases $linkCheckTestCases -Skip { + It "Pre-Requisistes link for '' is reachable: " -TestCases $linkCheckTestCases { param ($Url) - (Invoke-WebRequest $Url -UseBasicParsing) | Should Not Be $null + + foreach ($i in 1..5) { + try { + $result = Invoke-WebRequest $Url -UseBasicParsing + break; + } catch { + Start-Sleep -Seconds 1 + } + } + + $result | Should Not Be $null } } From 6ecb4524dc30c7e94850c92bdd20a0a90377f898 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Fri, 1 Dec 2017 17:22:17 -0800 Subject: [PATCH 3/3] [Feature] Change the comment --- test/powershell/Installer/WindowsInstaller.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/powershell/Installer/WindowsInstaller.Tests.ps1 b/test/powershell/Installer/WindowsInstaller.Tests.ps1 index a81cca46e37..8ee74bfcd76 100644 --- a/test/powershell/Installer/WindowsInstaller.Tests.ps1 +++ b/test/powershell/Installer/WindowsInstaller.Tests.ps1 @@ -17,7 +17,7 @@ Describe "Windows Installer" -Tags "Scenario" { ## Running 'Invoke-WebRequest' with WMF download URLs has been failing intermittently, ## because sometimes the URLs lead to a 'this download is no longer available' page. - ## Therefore, this test is disabled for now. + ## We use a retry logic here. Retry for 5 times with 1 second interval. It "Pre-Requisistes link for '' is reachable: " -TestCases $linkCheckTestCases { param ($Url)