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 2019/06/21 19:01:27 UTC

[ignite-teamcity-bot] 02/02: Trusted tests & suite history performance fixes: fix bug with race

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

dpavlov pushed a commit to branch test-hist-performance
in repository https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git

commit 6e190994dfadf6363b4e12d02ba64533b59ffe29
Author: Dmitriy Pavlov <dp...@apache.org>
AuthorDate: Fri Jun 21 22:01:12 2019 +0300

    Trusted tests & suite history performance fixes: fix bug with race
---
 .../org/apache/ignite/ci/tcbot/chain/PrChainsProcessorTest.java   | 2 --
 .../org/apache/ignite/tcbot/engine/chain/BuildChainProcessor.java | 4 ++--
 .../org/apache/ignite/tcbot/engine/chain/MultBuildRunCtx.java     | 8 +++++++-
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/ignite-tc-helper-web/src/test/java/org/apache/ignite/ci/tcbot/chain/PrChainsProcessorTest.java b/ignite-tc-helper-web/src/test/java/org/apache/ignite/ci/tcbot/chain/PrChainsProcessorTest.java
index fcfe597..fc1de27 100644
--- a/ignite-tc-helper-web/src/test/java/org/apache/ignite/ci/tcbot/chain/PrChainsProcessorTest.java
+++ b/ignite-tc-helper-web/src/test/java/org/apache/ignite/ci/tcbot/chain/PrChainsProcessorTest.java
@@ -108,8 +108,6 @@ public class PrChainsProcessorTest {
 
     //todo flaky test
     @Test
-    @Ignore
-    //todo fix failing test
     public void testTestFailureWithoutStatReportedAsBlocker() {
         IStringCompactor c = injector.getInstance(IStringCompactor.class);
 
diff --git a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/chain/BuildChainProcessor.java b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/chain/BuildChainProcessor.java
index d4d6ed9..579dbb0 100644
--- a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/chain/BuildChainProcessor.java
+++ b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/chain/BuildChainProcessor.java
@@ -185,13 +185,13 @@ public class BuildChainProcessor {
 
             final MultBuildRunCtx ctx = new MultBuildRunCtx(ref, compactor);
 
+            buildsForSuite.forEach(buildCompacted -> ctx.addBuild(loadChanges(buildCompacted, tcIgn)));
+
             //ask for history for the suite in parallel
             tcUpdatePool.getService().submit(() -> {
                 ctx.history(tcIgn, failRateBranchId);
             });
 
-            buildsForSuite.forEach(buildCompacted -> ctx.addBuild(loadChanges(buildCompacted, tcIgn)));
-
             analyzeTests(ctx, tcIgn, procLog);
 
             fillBuildCounts(ctx, tcIgn, includeScheduledInfo);
diff --git a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/chain/MultBuildRunCtx.java b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/chain/MultBuildRunCtx.java
index ad86342..f965db3 100644
--- a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/chain/MultBuildRunCtx.java
+++ b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/chain/MultBuildRunCtx.java
@@ -17,6 +17,7 @@
 
 package org.apache.ignite.tcbot.engine.chain;
 
+import com.google.common.base.Preconditions;
 import com.google.common.base.Strings;
 import com.google.common.cache.CacheBuilder;
 import java.util.ArrayList;
@@ -659,9 +660,14 @@ public class MultBuildRunCtx implements ISuiteResults {
 
     @Nullable
     ISuiteRunHistory suiteHist(ITeamcityIgnited tcIgn, Integer baseBranchId) {
+        Integer buildTypeIdId = buildTypeIdId();
+        Preconditions.checkNotNull(buildTypeIdId, "Build type ID should be filled");
+
         try {
             return historyCacheMap.get(baseBranchId,
-                () -> Optional.ofNullable(tcIgn.getSuiteRunHist(buildTypeIdId(), baseBranchId)))
+                () -> {
+                    return Optional.ofNullable(tcIgn.getSuiteRunHist(buildTypeIdId, baseBranchId));
+                })
                 .orElse(null);
         }
         catch (ExecutionException e) {