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/03/11 10:00:49 UTC

[phoenix] branch master updated: PHOENIX-6376 Update MetaDataProtocol.java for Phoenix 5.2 (addendum: increase timeout for BackwardCompatibilityIT#testSystemTaskCreationWithIndexAsyncRebuild())

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 8e06ada  PHOENIX-6376 Update MetaDataProtocol.java for Phoenix 5.2 (addendum: increase timeout for BackwardCompatibilityIT#testSystemTaskCreationWithIndexAsyncRebuild())
8e06ada is described below

commit 8e06adae43d1db57176f8b1406de01168cebf6ad
Author: Istvan Toth <st...@apache.org>
AuthorDate: Thu Mar 11 07:32:08 2021 +0100

    PHOENIX-6376 Update MetaDataProtocol.java for Phoenix 5.2 (addendum: increase timeout for BackwardCompatibilityIT#testSystemTaskCreationWithIndexAsyncRebuild())
---
 .../phoenix/end2end/BackwardCompatibilityIT.java     | 20 +++++++++++++++-----
 1 file changed, 15 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 17a7b9d..809fde4 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
@@ -326,7 +326,7 @@ public class BackwardCompatibilityIT {
         assertExpectedOutput(QUERY_CREATE_ADD);
 
         // Deletes with the new client
-        executeQueriesWithCurrentVersion(ADD_DELETE,url, NONE);
+        executeQueriesWithCurrentVersion(ADD_DELETE, url, NONE);
         executeQueriesWithCurrentVersion(QUERY_ADD_DELETE, url, NONE);
         assertExpectedOutput(QUERY_ADD_DELETE);
     }
@@ -389,10 +389,20 @@ 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);
+            // wait to finish the rebuild job (convoluted logic to preserve the AssertionError)
+            int retryCount=0;
+            while (true) {
+                try {
+                    Thread.sleep(5000);
+                    executeQueriesWithCurrentVersion(QUERY_INDEX_REBUILD_ASYNC, url, NONE);
+                    assertExpectedOutput(QUERY_INDEX_REBUILD_ASYNC);
+                    break;
+                } catch (AssertionError e) {
+                    if (retryCount++ > 10) {
+                        throw e;
+                    }
+                }
+            }
         }
     }