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 4b468bad27 PHOENIX-7062 Stabilize 
testDeletingStatsShouldNotFailWithADEWhenTableDropped
4b468bad27 is described below

commit 4b468bad2729c7d6e68fb158c4a0a6a8ec1e7e09
Author: Istvan Toth <st...@apache.org>
AuthorDate: Wed Oct 4 17:35:52 2023 +0200

    PHOENIX-7062 Stabilize testDeletingStatsShouldNotFailWithADEWhenTableDropped
---
 .../java/org/apache/phoenix/end2end/BasePermissionsIT.java  | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BasePermissionsIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BasePermissionsIT.java
index ba64cecae7..1e819b7208 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BasePermissionsIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BasePermissionsIT.java
@@ -45,6 +45,7 @@ import 
org.apache.hadoop.hbase.security.access.AccessController;
 import org.apache.hadoop.hbase.security.access.Permission;
 import org.apache.hadoop.hbase.security.access.UserPermission;
 import org.apache.hadoop.hbase.shaded.protobuf.ResponseConverter;
+import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.JVMClusterUtil.RegionServerThread;
 import org.apache.phoenix.coprocessor.MetaDataProtocol;
 import org.apache.phoenix.jdbc.PhoenixConnection;
@@ -569,6 +570,18 @@ public abstract class BasePermissionsIT extends BaseTest {
                 try (Connection conn = getConnection(); Statement stmt = 
conn.createStatement();) {
                     assertFalse(stmt.execute("UPDATE STATISTICS " + tableName 
+ " SET \""
                             + QueryServices.STATS_GUIDEPOST_WIDTH_BYTES_ATTRIB 
+ "\" = 5"));
+                    int retry = 20;
+                    while (retry-- > 0) {
+                        Thread.sleep(10000);
+                        ResultSet rs = stmt.executeQuery(
+                            "SELECT count(*) FROM SYSTEM.STATS where 
PHYSICAL_NAME = '"
+                            + 
SchemaUtil.getPhysicalHBaseTableName(tableName.getBytes(),
+                                isNamespaceMapped) + "'");
+                        rs.next();
+                        if (rs.getInt(1) > 0) {
+                            break;
+                        }
+                    }
                 }
                 return null;
             }

Reply via email to