glukos commented on a change in pull request #159: Show tests on TC board that 
were stable and have become flaky
URL: 
https://github.com/apache/ignite-teamcity-bot/pull/159#discussion_r409693850
 
 

 ##########
 File path: 
ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/issue/IssueDetector.java
 ##########
 @@ -484,6 +493,28 @@ private boolean registerTestFailIssues(ITeamcityIgnited 
tcIgnited,
             }
         }
 
+        double flakyRate = 0;
+
+        if (firstFailedBuildId == null || type == null) {
+            List<Invocation> invocations = runStat.getInvocations().
+                filter(invocation -> invocation != null && invocation.status() 
!= InvocationData.MISSING)
+                .collect(Collectors.toList());
+
+            int okTestsRow = (int)Math.ceil(Math.log(1 - cfg.confidence()) / 
Math.log(1 - cfg.flakyRate() / 100.0));
+
+            if (invocations.size() >= okTestsRow) {
+                List<Invocation> lastInvocations = 
invocations.subList(invocations.size() - okTestsRow, invocations.size());
 
 Review comment:
   Are we protected from ArrayIndexOutOfBounds here?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to