Skip to content

Commit

Permalink
Increase test work item timeout. Fix for ProcessHelixFiles.ps1 (#2200)
Browse files Browse the repository at this point in the history
* Test fixes

* disable RadioButtonsTests.GamepadCanEscapeAndDoesNotSelectWithFocus

Co-authored-by: Keith Mahoney <keith.mahoney@microsoft.com>
  • Loading branch information
kmahone and Keith Mahoney authored Apr 1, 2020
1 parent 9660811 commit e9db63a
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 13 deletions.
4 changes: 2 additions & 2 deletions build/Helix/GenerateTestProjFile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ foreach ($testModule in $testModules)
$projFileContent += @"
<HelixWorkItem Include="$($testClass.Name)" Condition="'`$(TestSuite)'=='$($JobTestSuiteName)'">
<Timeout>00:20:00</Timeout>
<Timeout>00:30:00</Timeout>
<Command>call %HELIX_CORRELATION_PAYLOAD%\runtests.cmd /select:"(@Name='$($testClass.Name).*'$(if ($testSuiteExists) { "and not @TestSuite='*'" }))$($TaefQueryToAppend)"</Command>
</HelixWorkItem>
"@
Expand All @@ -302,7 +302,7 @@ foreach ($testModule in $testModules)
$projFileContent += @"
<HelixWorkItem Include="$($testClass.Name)-$testSuiteName" Condition="'`$(TestSuite)'=='$($JobTestSuiteName)'">
<Timeout>00:20:00</Timeout>
<Timeout>00:30:00</Timeout>
<Command>call %HELIX_CORRELATION_PAYLOAD%\runtests.cmd /select:"(@Name='$($testClass.Name).*' and @TestSuite='$testSuiteName')$($TaefQueryToAppend)"</Command>
</HelixWorkItem>
"@
Expand Down
23 changes: 13 additions & 10 deletions build/Helix/ProcessHelixFiles.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
21 changes: 20 additions & 1 deletion build/Helix/runtests.cmd
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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=
Expand All @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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
type testResults.xml

echo %TIME%
1 change: 1 addition & 0 deletions dev/RadioButtons/InteractionTests/RadioButtonsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down

0 comments on commit e9db63a

Please sign in to comment.