From e9db63ac50c13dadbf95f9df6f0821ed850eb384 Mon Sep 17 00:00:00 2001 From: Keith Mahoney <41657372+kmahone@users.noreply.github.com> Date: Tue, 31 Mar 2020 17:24:04 -0700 Subject: [PATCH] Increase test work item timeout. Fix for ProcessHelixFiles.ps1 (#2200) * Test fixes * disable RadioButtonsTests.GamepadCanEscapeAndDoesNotSelectWithFocus Co-authored-by: Keith Mahoney --- build/Helix/GenerateTestProjFile.ps1 | 4 ++-- build/Helix/ProcessHelixFiles.ps1 | 23 +++++++++++-------- build/Helix/runtests.cmd | 21 ++++++++++++++++- .../InteractionTests/RadioButtonsTests.cs | 1 + 4 files changed, 36 insertions(+), 13 deletions(-) diff --git a/build/Helix/GenerateTestProjFile.ps1 b/build/Helix/GenerateTestProjFile.ps1 index bfcda1ee23..483b6d0cc7 100644 --- a/build/Helix/GenerateTestProjFile.ps1 +++ b/build/Helix/GenerateTestProjFile.ps1 @@ -291,7 +291,7 @@ foreach ($testModule in $testModules) $projFileContent += @" - 00:20:00 + 00:30:00 call %HELIX_CORRELATION_PAYLOAD%\runtests.cmd /select:"(@Name='$($testClass.Name).*'$(if ($testSuiteExists) { "and not @TestSuite='*'" }))$($TaefQueryToAppend)" "@ @@ -302,7 +302,7 @@ foreach ($testModule in $testModules) $projFileContent += @" - 00:20:00 + 00:30:00 call %HELIX_CORRELATION_PAYLOAD%\runtests.cmd /select:"(@Name='$($testClass.Name).*' and @TestSuite='$testSuiteName')$($TaefQueryToAppend)" "@ diff --git a/build/Helix/ProcessHelixFiles.ps1 b/build/Helix/ProcessHelixFiles.ps1 index 58e4a5df50..b010fafb6d 100644 --- a/build/Helix/ProcessHelixFiles.ps1 +++ b/build/Helix/ProcessHelixFiles.ps1 @@ -132,19 +132,22 @@ if(Test-Path $visualTreeMasterFolder) { $filesToDelete = @() $versionedMasters = $masterFiles | Where { $_.BaseName.StartsWith("$prefix-") } | Sort-Object -Property Name -Descending - for ($i=0; $i -lt $versionedMasters.Length-1; $i++) + if($versionedMasters.Count > 1) { - $v1 = Get-Content $versionedMasters[$i].FullName - $v2 = Get-Content $versionedMasters[$i+1].FullName - $diff = Compare-Object $v1 $v2 - if($diff.Length -eq 0) + for ($i=0; $i -lt $versionedMasters.Length-1; $i++) { - $filesToDelete += $versionedMasters[$i] + $v1 = Get-Content $versionedMasters[$i].FullName + $v2 = Get-Content $versionedMasters[$i+1].FullName + $diff = Compare-Object $v1 $v2 + if($diff.Length -eq 0) + { + $filesToDelete += $versionedMasters[$i] + } + } + $filesToDelete | ForEach-Object { + Write-Host "Deleting $($_.Name)" + Remove-Item $_.FullName } - } - $filesToDelete | ForEach-Object { - Write-Host "Deleting $($_.Name)" - Remove-Item $_.FullName } Write-Host "Renaming $($versionedMasters[-1].Name) to $prefix.xml" diff --git a/build/Helix/runtests.cmd b/build/Helix/runtests.cmd index 8189ed6a1f..ca3756a67c 100644 --- a/build/Helix/runtests.cmd +++ b/build/Helix/runtests.cmd @@ -1,7 +1,11 @@ setlocal ENABLEDELAYEDEXPANSION +echo %TIME% + robocopy %HELIX_CORRELATION_PAYLOAD% . /s /NP > NUL +echo %TIME% + reg add HKLM\Software\Policies\Microsoft\Windows\Appx /v AllowAllTrustedApps /t REG_DWORD /d 1 /f rem enable dump collection for our test apps: @@ -12,12 +16,17 @@ FOR %%A IN (MUXControlsTestApp.exe,IXMPTestApp.exe,NugetPackageTestApp.exe,Nuget %systemroot%\sysnative\cmd.exe /c reg add "HKLM\Software\Microsoft\Windows\Windows Error Reporting\LocalDumps\%%A" /v DumpCount /t REG_DWORD /d 10 /f ) +echo %TIME% + :: kill dhandler, which is a tool designed to handle unexpected windows appearing. But since our tests are :: expected to show UI we don't want it running. taskkill -f -im dhandler.exe +echo %TIME% powershell -ExecutionPolicy Bypass .\EnsureMachineState.ps1 +echo %TIME% powershell -ExecutionPolicy Bypass .\InstallTestAppDependencies.ps1 +echo %TIME% set testBinaryCandidates=MUXControls.Test.dll MUXControlsTestApp.appx IXMPTestApp.appx MUXControls.ReleaseTest.dll set testBinaries= @@ -27,7 +36,9 @@ for %%B in (%testBinaryCandidates%) do ( ) ) +echo %TIME% te %testBinaries% /enablewttlogging /unicodeOutput:false /sessionTimeout:0:15 /testtimeout:0:10 /screenCaptureOnError %* +echo %TIME% move te.wtl te_original.wtl @@ -45,7 +56,9 @@ rem The first time, we'll just re-run failed tests once. In many cases, tests f rem a single re-run will be sufficient to detect many unreliable tests. if "%FailedTestQuery%" == "" goto :SkipReruns +echo %TIME% te %testBinaries% /enablewttlogging /unicodeOutput:false /sessionTimeout:0:15 /testtimeout:0:10 /screenCaptureOnError /select:"%FailedTestQuery%" +echo %TIME% move te.wtl te_rerun.wtl @@ -63,7 +76,9 @@ for /F "tokens=* usebackq" %%I IN (`powershell -ExecutionPolicy Bypass .\OutputF if "%FailedTestQuery%" == "" goto :SkipReruns +echo %TIME% te %testBinaries% /enablewttlogging /unicodeOutput:false /sessionTimeout:0:15 /testtimeout:0:10 /screenCaptureOnError /testmode:Loop /LoopTest:8 /select:"%FailedTestQuery%" +echo %TIME% move te.wtl te_rerun_multiple.wtl @@ -73,9 +88,13 @@ powershell -ExecutionPolicy Bypass .\CopyVisualTreeMasters.ps1 :SkipReruns +echo %TIME% powershell -ExecutionPolicy Bypass .\OutputSubResultsJsonFiles.ps1 te_original.wtl te_rerun.wtl te_rerun_multiple.wtl %testnameprefix% powershell -ExecutionPolicy Bypass .\ConvertWttLogToXUnit.ps1 te_original.wtl te_rerun.wtl te_rerun_multiple.wtl testResults.xml %testnameprefix% +echo %TIME% copy /y *_subresults.json %HELIX_WORKITEM_UPLOAD_ROOT% -type testResults.xml \ No newline at end of file +type testResults.xml + +echo %TIME% \ No newline at end of file diff --git a/dev/RadioButtons/InteractionTests/RadioButtonsTests.cs b/dev/RadioButtons/InteractionTests/RadioButtonsTests.cs index 312c8535dd..c2175846df 100644 --- a/dev/RadioButtons/InteractionTests/RadioButtonsTests.cs +++ b/dev/RadioButtons/InteractionTests/RadioButtonsTests.cs @@ -436,6 +436,7 @@ public void RS2MultiColumnKeyboardTest() } [TestMethod] + [TestProperty("Ignore", "True")] // Disabled due to: RadioButtonsTests.GamepadCanEscapeAndDoesNotSelectWithFocus is unreliable. #2202 public void GamepadCanEscapeAndDoesNotSelectWithFocus() { using (var setup = new TestSetupHelper("RadioButtons Tests"))