File tree Expand file tree Collapse file tree 6 files changed +37
-0
lines changed 
conventions/src/main/kotlin Expand file tree Collapse file tree 6 files changed +37
-0
lines changed Original file line number Diff line number Diff line change 99      no-build-cache :
1010        type : boolean 
1111        required : false 
12+       max-test-retries :
13+         type : int 
14+         required : false 
1215      skip-openj9-tests :
1316        type : boolean 
1417        required : false 
@@ -267,6 +270,7 @@ jobs:
267270          -Porg.gradle.java.installations.paths=${{ steps.setup-test-java.outputs.path }} 
268271          -Porg.gradle.java.installations.auto-download=false 
269272          ${{ inputs.no-build-cache && ' --no-build-cache' || '' }} 
273+           ${{ inputs.max-test-retries && ' -PmaxTestRetries=' + inputs.max-test-retries || '' }} 
270274
271275       - name : Build scan 
272276        if : ${{ !cancelled() && hashFiles('build-scan.txt') != '' }} 
Original file line number Diff line number Diff line change @@ -10,11 +10,19 @@ jobs:
1010  common :
1111    uses : ./.github/workflows/build-common.yml 
1212    with :
13+       max-test-retries : 0 
1314      no-build-cache : true 
1415
1516  test-latest-deps :
1617    uses : ./.github/workflows/reusable-test-latest-deps.yml 
1718    with :
19+       max-test-retries : 0 
20+       no-build-cache : true 
21+ 
22+   test-indy :
23+     uses : ./.github/workflows/reusable-test-indy.yml 
24+     with :
25+       max-test-retries : 0 
1826      no-build-cache : true 
1927
2028  #  muzzle is not included here because it doesn't use gradle cache anyway and so is already covered
Original file line number Diff line number Diff line change 99jobs :
1010  common :
1111    uses : ./.github/workflows/build-common.yml 
12+     with :
13+       max-test-retries : 0 
1214
1315  test-latest-deps :
1416    uses : ./.github/workflows/reusable-test-latest-deps.yml 
17+     with :
18+       max-test-retries : 0 
19+ 
20+   test-indy :
21+     uses : ./.github/workflows/reusable-test-indy.yml 
22+     with :
23+       max-test-retries : 0 
1524
1625  muzzle :
1726    uses : ./.github/workflows/reusable-muzzle.yml 
Original file line number Diff line number Diff line change 99      no-build-cache :
1010        type : boolean 
1111        required : false 
12+       max-test-retries :
13+         type : int 
14+         required : false 
1215
1316permissions :
1417  contents : read 
7881          ${{ env.test-tasks }} 
7982          -PtestIndy=true 
8083          ${{ inputs.no-build-cache && ' --no-build-cache' || '' }} 
84+           ${{ inputs.max-test-retries && ' -PmaxTestRetries=' + inputs.max-test-retries || '' }} 
8185
8286       - name : Build scan 
8387        if : ${{ !cancelled() && hashFiles('build-scan.txt') != '' }} 
Original file line number Diff line number Diff line change 99      no-build-cache :
1010        type : boolean 
1111        required : false 
12+       max-test-retries :
13+         type : int 
14+         required : false 
1215
1316permissions :
1417  contents : read 
7679          ${{ env.test-tasks }} 
7780          -PtestLatestDeps=true 
7881          ${{ inputs.no-build-cache && ' --no-build-cache' || '' }} 
82+           ${{ inputs.max-test-retries && ' -PmaxTestRetries=' + inputs.max-test-retries || '' }} 
7983
8084       - name : Build scan 
8185        if : ${{ !cancelled() && hashFiles('build-scan.txt') != '' }} 
Original file line number Diff line number Diff line change @@ -366,6 +366,14 @@ tasks.withType<Test>().configureEach {
366366  //  This value is quite big because with lower values (3 mins) we were experiencing large number of false positives
367367  timeout.set(Duration .ofMinutes(15 ))
368368
369+   val  defaultMaxRetries =  if  (System .getenv().containsKey(" CI"  )) 5  else  0 
370+   val  maxTestRetries =  gradle.startParameter.projectProperties[" maxTestRetries"  ]?.toInt() ? :  defaultMaxRetries
371+ 
372+   develocity.testRetry {
373+     //  You can see tests that were retried by this mechanism in the collected test reports and build scans.
374+     maxRetries.set(maxTestRetries);
375+   }
376+ 
369377  reports {
370378    junitXml.isOutputPerTestCase =  true 
371379  }
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments