From b4dfab9591915f55a3d61ada0f1b672b9f8c5c4a Mon Sep 17 00:00:00 2001 From: Adrien Piquerez Date: Wed, 28 Aug 2024 12:07:05 +0200 Subject: [PATCH] Enable test retry selectively Test retry is disabled in all compilation test classes, where each test is responsible for compiling many files separately. --- project/Build.scala | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/project/Build.scala b/project/Build.scala index f390f32533a3..6c6666b9f62b 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -276,6 +276,18 @@ object Build { val config = develocityConfiguration.value val buildScan = config.buildScan val buildCache = config.buildCache + // disable test retry on compilation test classes + val noRetryTestClasses = Set( + "dotty.tools.dotc.BestEffortOptionsTests", + "dotty.tools.dotc.CompilationTests", + "dotty.tools.dotc.FromTastyTests", + "dotty.tools.dotc.IdempotencyTests", + "dotty.tools.dotc.ScalaJSCompilationTests", + "dotty.tools.dotc.TastyBootstrapTests", + "dotty.tools.dotc.coverage.CoverageTests", + "dotty.tools.dotc.transform.PatmatExhaustivityTest", + "dotty.tools.repl.ScriptedTests" + ) config .withProjectId(ProjectId("scala3")) .withServer(config.server.withUrl(Some(url("https://develocity.scala-lang.org")))) @@ -293,6 +305,13 @@ object Build { .withLocal(buildCache.local.withEnabled(false)) .withRemote(buildCache.remote.withEnabled(false)) ) + .withTestRetryConfiguration( + config.testRetryConfiguration + .withFlakyTestPolicy(FlakyTestPolicy.Fail) + .withMaxRetries(1) + .withMaxFailures(10) + .withClassesFilter((className, _) => !noRetryTestClasses.contains(className)) + ) } )