Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 31ae7c2

Browse files
committedAug 20, 2024·
Hacking test script
1 parent 12969bb commit 31ae7c2

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed
 

‎src/tests/Common/CLRTest.Execute.Batch.targets

+13
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,15 @@ if not defined CLRTestExecutionArguments (set CLRTestExecutionArguments=$(CLRTes
146146
]]></BatchCLRTestArgPrep>
147147

148148
<!-- By default, be prepared to do a full check -->
149+
<BatchLoopPart2 Condition="'$(CLRTestLoop)' == 'true'"><![CDATA[SET /A RetryCount=%RetryCount%-1
150+
IF NOT "%RetryCount%"=="0" (
151+
GOTO :RetryingRerun
152+
) ELSE (
153+
ECHO END EXECUTION - PASSED BUT ALSO FAILED
154+
ECHO FAILED
155+
popd
156+
Exit /b 1
157+
)]]></BatchLoopPart2>
149158
<BatchCLRTestExitCodeCheck><![CDATA[
150159
ECHO Expected: %CLRTestExpectedExitCode%
151160
ECHO Actual: %CLRTestExitCode%
@@ -157,6 +166,7 @@ IF NOT "%CLRTestExitCode%"=="%CLRTestExpectedExitCode%" (
157166
) ELSE (
158167
ECHO END EXECUTION - PASSED
159168
ECHO PASSED
169+
$(BatchLoopPart2)
160170
popd
161171
Exit /b 0
162172
)
@@ -305,6 +315,8 @@ REM Local CoreShim requested - see MSBuild property 'CLRTestScriptLocalCoreShim'
305315
ECHO Copying '%CORE_ROOT%\CoreShim.dll'...
306316
COPY /y %CORE_ROOT%\CoreShim.dll .
307317
]]></BatchCopyCoreShimLocalCmds>
318+
<BatchLoopPart1 Condition="'$(CLRTestLoop)' == 'true'"><![CDATA[SET RetryCount=100
319+
:RetryingRerun]]></BatchLoopPart1>
308320
<BatchCLRTestLaunchCmds Condition="'$(CLRTestKind)' == 'BuildAndRun' And $(TargetOS) != 'android'">
309321
<![CDATA[
310322
$(BatchLinkerTestLaunchCmds)
@@ -323,6 +335,7 @@ if defined RunCrossGen2 (
323335
)
324336
325337
ECHO %LAUNCHER% %ExePath% %CLRTestExecutionArguments%
338+
$(BatchLoopPart1)
326339
%LAUNCHER% %ExePath% %CLRTestExecutionArguments%
327340
set CLRTestExitCode=!ERRORLEVEL!
328341
if defined RunCrossGen2 (

‎src/tests/Common/Coreclr.TestWrapper/CoreclrTestWrapperLib.cs

+2
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,7 @@ public int RunTest(string executable, string outputFile, string errorFile, strin
687687
using (var errorWriter = new StreamWriter(errorStream))
688688
using (Process process = new Process())
689689
{
690+
outputWriter.WriteLine("Andrew modified CoreclrTestWrapper is running '" + executable + "'");
690691
if (MobileAppHandler.IsRetryRequested(testBinaryBase))
691692
{
692693
outputWriter.WriteLine("\nWork item retry had been requested earlier - skipping test...");
@@ -719,6 +720,7 @@ public int RunTest(string executable, string outputFile, string errorFile, strin
719720
Task copyOutput = process.StandardOutput.BaseStream.CopyToAsync(outputStream, 4096, cts.Token);
720721
Task copyError = process.StandardError.BaseStream.CopyToAsync(errorStream, 4096, cts.Token);
721722

723+
722724
if (process.WaitForExit(timeout))
723725
{
724726
// Process completed. Check process.ExitCode here.

‎src/tests/readytorun/coreroot_determinism/coreroot_determinism.csproj

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
<!-- We skip the ReadyToRun tests when sanitized due to build complexity -->
1111
<DisableProjectBuild Condition="'$(EnableNativeSanitizers)' != ''">true</DisableProjectBuild>
1212
<OldToolsVersion>2.0</OldToolsVersion>
13+
<!-- Rerun the test for 100 times or stop if we get a failure -->
14+
<CLRTestLoop>true</CLRTestLoop>
1315
</PropertyGroup>
1416
<ItemGroup>
1517
<Compile Include="Program.cs" />

0 commit comments

Comments
 (0)
Please sign in to comment.