File tree 1 file changed +13
-2
lines changed
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -298,6 +298,17 @@ class CommunityBuildTest:
298
298
* @param arguments Arguments to pass to the testing program
299
299
*/
300
300
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
+
301
312
log(s " Building $project with dotty-bootstrapped $compilerVersion... " )
302
313
303
314
val projectDir = communitybuildDir.resolve(" community-projects" ).resolve(project)
@@ -312,9 +323,9 @@ class CommunityBuildTest:
312
323
| """ .stripMargin)
313
324
}
314
325
315
- val exitCode = exec(projectDir, command, arguments : _* )
326
+ val testsCompletedSuccessfully = execTimes( exec(projectDir, command, arguments : _* ), 3 )
316
327
317
- if (exitCode != 0 ) {
328
+ if (! testsCompletedSuccessfully ) {
318
329
fail(s """
319
330
|
320
331
| $command exited with an error code. To reproduce without JUnit, use:
You can’t perform that action at this time.
0 commit comments