You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by st...@apache.org on 2021/09/16 06:03:40 UTC

[phoenix] branch 5.1 updated: PHOENIX-6546 BackwardCompatibilityIT#testSystemTaskCreationWithIndexAsyncRebuild is flakey

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

stoty pushed a commit to branch 5.1
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/5.1 by this push:
     new f26ec20  PHOENIX-6546 BackwardCompatibilityIT#testSystemTaskCreationWithIndexAsyncRebuild is flakey
f26ec20 is described below

commit f26ec20a6eaff4fffeb3100f0dd782ac8c62abb7
Author: Istvan Toth <st...@apache.org>
AuthorDate: Wed Sep 15 14:24:41 2021 +0200

    PHOENIX-6546 BackwardCompatibilityIT#testSystemTaskCreationWithIndexAsyncRebuild is flakey
---
 .../phoenix/end2end/BackwardCompatibilityIT.java   | 23 ++++++++++++++++++----
 .../gold_files/gold_query_index_rebuild_async.txt  |  2 +-
 2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BackwardCompatibilityIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BackwardCompatibilityIT.java
index a1b2d0e..741fad5 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BackwardCompatibilityIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BackwardCompatibilityIT.java
@@ -106,6 +106,10 @@ public class BackwardCompatibilityIT {
     public synchronized void doSetup() throws Exception {
         tmpDir = System.getProperty("java.io.tmpdir");
         conf = HBaseConfiguration.create();
+        conf.set(QueryServices.TASK_HANDLING_INTERVAL_MS_ATTRIB,
+            Long.toString(Long.MAX_VALUE));
+        conf.set(QueryServices.TASK_HANDLING_INITIAL_DELAY_MS_ATTRIB,
+            Long.toString(Long.MAX_VALUE));
         hbaseTestUtil = new HBaseTestingUtility(conf);
         setUpConfigForMiniCluster(conf);
         conf.set(QueryServices.EXTRA_JDBC_ARGUMENTS_ATTRIB, QueryServicesOptions.DEFAULT_EXTRA_JDBC_ARGUMENTS);
@@ -387,10 +391,21 @@ public class BackwardCompatibilityIT {
         if (majorVersion > 4 || (majorVersion == 4 && minorVersion >= 15)) {
             executeQueryWithClientVersion(compatibleClientVersion,
                 INDEX_REBUILD_ASYNC, zkQuorum);
-            // wait 5 seconds to finish the rebuild job
-            Thread.sleep(5000);
-            executeQueriesWithCurrentVersion(QUERY_INDEX_REBUILD_ASYNC, url, NONE);
-            assertExpectedOutput(QUERY_INDEX_REBUILD_ASYNC);
+            //Check if the task is added.
+            //It won't start because we set the task intervals to long.MAX_VALUE
+            int retryCount=0;
+            while (true) {
+                try {
+                    executeQueriesWithCurrentVersion(QUERY_INDEX_REBUILD_ASYNC, url, NONE);
+                    assertExpectedOutput(QUERY_INDEX_REBUILD_ASYNC);
+                    break;
+                } catch (AssertionError e) {
+                    if (retryCount++ > 10) {
+                        throw e;
+                    }
+                    Thread.sleep(5000);
+                }
+            }
         }
     }
 
diff --git a/phoenix-core/src/it/resources/gold_files/gold_query_index_rebuild_async.txt b/phoenix-core/src/it/resources/gold_files/gold_query_index_rebuild_async.txt
index ff020c5..4f96ce0 100644
--- a/phoenix-core/src/it/resources/gold_files/gold_query_index_rebuild_async.txt
+++ b/phoenix-core/src/it/resources/gold_files/gold_query_index_rebuild_async.txt
@@ -17,7 +17,7 @@
  */
 
 'TASK_TYPE','TABLE_NAME','TASK_STATUS','TASK_PRIORITY'
-'2','TI','COMPLETED','4'
+'2','TI','CREATED','4'
 'K','V'
 'key1','val2'
 'key3','val3'