You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by dp...@apache.org on 2018/11/25 14:41:40 UTC

[ignite-teamcity-bot] branch ignite-9542-new-run-stripe updated: IGNITE-9542 Protecting from duplicate register

This is an automated email from the ASF dual-hosted git repository.

dpavlov pushed a commit to branch ignite-9542-new-run-stripe
in repository https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git


The following commit(s) were added to refs/heads/ignite-9542-new-run-stripe by this push:
     new dc020c6  IGNITE-9542 Protecting from duplicate register
dc020c6 is described below

commit dc020c61d91ada41c7fbf22672c94e7e8291f621
Author: Dmitriy Pavlov <dp...@apache.org>
AuthorDate: Sun Nov 25 17:41:41 2018 +0300

    IGNITE-9542 Protecting from duplicate register
---
 .../teamcity/ignited/runhist/InvocationData.java   | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/runhist/InvocationData.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/runhist/InvocationData.java
index 3d4798d..b5f1b1a 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/runhist/InvocationData.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/runhist/InvocationData.java
@@ -59,20 +59,26 @@ public class InvocationData {
     public void add(IStringCompactor c, TestCompacted testCompacted, int build, long startDate) {
         final boolean failedTest = testCompacted.isFailedTest(c);
 
-        final Invocation invocation = invocationMap.computeIfAbsent(build, Invocation::new);
+        if (invocationMap.containsKey(build))
+            return;
+
+        final Invocation invocation = new Invocation(build);
+        Invocation prevVal = invocationMap.putIfAbsent(build, invocation);
 
         final int failCode = failedTest
-                ? (testCompacted.isIgnoredTest() || testCompacted.isMutedTest())
-                        ? MUTED
-                        : FAILURE
-                : OK;
+            ? (testCompacted.isIgnoredTest() || testCompacted.isMutedTest())
+            ? MUTED
+            : FAILURE
+            : OK;
 
         invocation.status = (byte)failCode;
         invocation.startDate = startDate;
 
-        allHistRuns++;
-        if (failedTest)
-            allHistFailures++;
+        if (prevVal == null) {
+            allHistRuns++;
+            if (failedTest)
+                allHistFailures++;
+        }
 
         removeEldiest();
     }