소스 검색

feat(Build): Add 3 retry when the LeakTests fails

Giuseppe Lippolis 3 년 전
부모
커밋
19e4132c6b
2개의 변경된 파일9개의 추가작업 그리고 5개의 파일을 삭제
  1. 1 1
      build/JetBrains.dotMemoryUnit.props
  2. 8 4
      nukebuild/Build.cs

+ 1 - 1
build/JetBrains.dotMemoryUnit.props

@@ -1,5 +1,5 @@
 <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup>
-    <PackageReference Include="JetBrains.dotMemoryUnit" Version="3.0.20171219.105559" />
+    <PackageReference Include="JetBrains.DotMemoryUnit" Version="3.1.20200127.214830" />
   </ItemGroup>
 </Project>

+ 8 - 4
nukebuild/Build.cs

@@ -253,10 +253,14 @@ partial class Build : NukeBuild
         .DependsOn(Compile)
         .Executes(() =>
         {
-            var testAssembly = "tests\\Avalonia.LeakTests\\bin\\Release\\net461\\Avalonia.LeakTests.dll";
-            DotMemoryUnit(
-                $"{XunitPath.DoubleQuoteIfNeeded()} --propagate-exit-code -- {testAssembly}",
-                timeout: 120_000);
+            void DoMemoryTest()
+            {
+                var testAssembly = "tests\\Avalonia.LeakTests\\bin\\Release\\net461\\Avalonia.LeakTests.dll";
+                DotMemoryUnit(
+                    $"{XunitPath.DoubleQuoteIfNeeded()} --propagate-exit-code -- {testAssembly}",
+                    timeout: 120_000);
+            }
+            ControlFlow.ExecuteWithRetry(DoMemoryTest, waitInSeconds: 3);
         });
 
     Target ZipFiles => _ => _