You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by ya...@apache.org on 2021/01/06 17:07:08 UTC
[phoenix] branch master updated: PHOENIX-6297 Fix
IndexMetadataIT.testAsyncRebuildAll test flapper
This is an automated email from the ASF dual-hosted git repository.
yanxinyi 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 8c1ad86 PHOENIX-6297 Fix IndexMetadataIT.testAsyncRebuildAll test flapper
8c1ad86 is described below
commit 8c1ad861f6e663d16cd8012a06878391a2275850
Author: Xinyi Yan <xy...@salesforce.com>
AuthorDate: Mon Jan 4 15:57:02 2021 -0800
PHOENIX-6297 Fix IndexMetadataIT.testAsyncRebuildAll test flapper
Signed-off-by: Xinyi Yan <ya...@apache.org>
---
.../apache/phoenix/end2end/index/IndexMetadataIT.java | 17 +++++++++++------
.../src/test/java/org/apache/phoenix/util/TestUtil.java | 2 +-
2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
index 00d9c8c..35523cf 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
@@ -17,7 +17,6 @@
*/
package org.apache.phoenix.end2end.index;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SYSTEM_CATALOG_SCHEMA;
import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TABLE_NAME;
import static org.apache.phoenix.util.TestUtil.INDEX_DATA_SCHEMA;
import static org.apache.phoenix.util.TestUtil.TEST_PROPERTIES;
@@ -43,7 +42,6 @@ import java.util.Properties;
import org.apache.hadoop.hbase.client.Table;
import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
import org.apache.hadoop.hbase.util.Bytes;
-import org.apache.phoenix.end2end.DropTableWithViewsIT;
import org.apache.phoenix.end2end.ParallelStatsDisabledIT;
import org.apache.phoenix.exception.SQLExceptionCode;
import org.apache.phoenix.jdbc.PhoenixConnection;
@@ -64,7 +62,6 @@ import org.apache.phoenix.util.StringUtil;
import org.apache.phoenix.util.TestUtil;
import org.junit.Test;
-
public class IndexMetadataIT extends ParallelStatsDisabledIT {
private enum Order {ASC, DESC};
@@ -687,9 +684,17 @@ public class IndexMetadataIT extends ParallelStatsDisabledIT {
TestUtil.waitForIndexState(conn, indexName, PIndexState.ACTIVE);
- // Check task status and other column values.
- DropTableWithViewsIT.assertTaskColumns(conn, PTable.TaskStatus.COMPLETED.toString(),
- PTable.TaskType.INDEX_REBUILD, testTable, null, null, null,indexName);
+ // Check task status
+ String query = "SELECT * " + " FROM " + PhoenixDatabaseMetaData.SYSTEM_TASK_NAME + " WHERE " +
+ PhoenixDatabaseMetaData.TASK_TYPE + " = " + PTable.TaskType.INDEX_REBUILD.getSerializedValue() +
+ " AND " + PhoenixDatabaseMetaData.TABLE_NAME + " = '" + testTable + "'";
+
+ rs = conn.createStatement().executeQuery(query);
+ assertTrue(rs.next());
+ String taskStatus = rs.getString(PhoenixDatabaseMetaData.TASK_STATUS);
+ assertEquals(PTable.TaskStatus.COMPLETED.toString(), taskStatus);
+ String data = rs.getString(PhoenixDatabaseMetaData.TASK_DATA);
+ assertEquals(true, data.contains("\"IndexName\":\"" + indexName));
// Check that the value is updated to correct one
val = getIndexValue(conn, indexName, 2);
diff --git a/phoenix-core/src/test/java/org/apache/phoenix/util/TestUtil.java b/phoenix-core/src/test/java/org/apache/phoenix/util/TestUtil.java
index d99cbf1..d2fd650 100644
--- a/phoenix-core/src/test/java/org/apache/phoenix/util/TestUtil.java
+++ b/phoenix-core/src/test/java/org/apache/phoenix/util/TestUtil.java
@@ -1059,7 +1059,7 @@ public class TestUtil {
}
public static void waitForIndexState(Connection conn, String fullIndexName, PIndexState expectedIndexState) throws InterruptedException, SQLException {
- int maxTries = 60, nTries = 0;
+ int maxTries = 120, nTries = 0;
PIndexState actualIndexState = null;
do {
String schema = SchemaUtil.getSchemaNameFromFullName(fullIndexName);