File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -298,6 +298,17 @@ class CommunityBuildTest:
298298 * @param arguments Arguments to pass to the testing program
299299 */
300300 def test (project : String , command : String , arguments : Seq [String ]): Unit = {
301+ @ annotation.tailrec
302+ def execTimes (task : => Int , timesToRerun : Int ): Boolean =
303+ val exitCode = task
304+ if exitCode == 0
305+ then true
306+ else if timesToRerun == 0
307+ then false
308+ else
309+ log(s " Rerunning tests in $project because of a previous run failure. " )
310+ execTimes(task, timesToRerun - 1 )
311+
301312 log(s " Building $project with dotty-bootstrapped $compilerVersion... " )
302313
303314 val projectDir = communitybuildDir.resolve(" community-projects" ).resolve(project)
@@ -312,9 +323,9 @@ class CommunityBuildTest:
312323 | """ .stripMargin)
313324 }
314325
315- val exitCode = exec(projectDir, command, arguments : _* )
326+ val testsCompletedSuccessfully = execTimes( exec(projectDir, command, arguments : _* ), 3 )
316327
317- if (exitCode != 0 ) {
328+ if (! testsCompletedSuccessfully ) {
318329 fail(s """
319330 |
320331 | $command exited with an error code. To reproduce without JUnit, use:
You can’t perform that action at this time.
0 commit comments