Source:
public void testIndexToolVerifyAfterOption() throws Exception { if (localIndex || transactional || !directApi || useSnapshot || useTenantId) { return; } Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); try (Connection conn = DriverManager.getConnection(getUrl(), props)) { String schemaName = generateUniqueName(); String dataTableName = generateUniqueName(); String dataTableFullName = SchemaUtil.getTableName(schemaName, dataTableName); String indexTableName = generateUniqueName(); String viewName = generateUniqueName(); String viewFullName = SchemaUtil.getTableName(schemaName, viewName); conn.createStatement().execute("CREATE TABLE " + dataTableFullName + " (ID INTEGER NOT NULL PRIMARY KEY, NAME VARCHAR, ZIP INTEGER) " + tableDDLOptions); conn.commit(); conn.createStatement().execute("CREATE VIEW " + viewFullName + " AS SELECT * FROM " + dataTableFullName); conn.commit(); conn.createStatement().execute("upsert into " + viewFullName + " values (1, 'Phoenix', 12345)"); conn.commit(); IndexRegionObserver.setIgnoreIndexRebuildForTesting(true); conn.createStatement().execute(String.format( "CREATE INDEX %s ON %s (NAME) INCLUDE (ZIP) ASYNC", indexTableName, viewFullName)); runIndexTool(directApi, useSnapshot, schemaName, viewName, indexTableName, null, -1, IndexTool.IndexVerifyType.AFTER); Cell cell = getErrorMessageFromIndexToolOutputTable(conn, dataTableFullName, "_IDX_" + dataTableFullName); try { String expectedErrorMsg = "Missing index row beyond maxLookBack"; String actualErrorMsg = Bytes.toString(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength()); assertTrue(expectedErrorMsg.equals(actualErrorMsg)); }catch(Exception ex){ Assert.fail("Fail to parsing the error message from IndexToolOutputTable"); } IndexRegionObserver.setIgnoreIndexRebuildForTesting(false); dropIndexToolTables(conn); } }

Target:
public void testIndexToolVerifyAfterOption() throws Exception { if (localIndex || transactional || !directApi || useSnapshot || useTenantId) { return; } Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); try (Connection conn = DriverManager.getConnection(getUrl(), props)) { String schemaName = generateUniqueName(); String dataTableName = generateUniqueName(); String dataTableFullName = SchemaUtil.getTableName(schemaName, dataTableName); String indexTableName = generateUniqueName(); String viewName = generateUniqueName(); String viewFullName = SchemaUtil.getTableName(schemaName, viewName); conn.createStatement().execute("CREATE TABLE " + dataTableFullName + " (ID INTEGER NOT NULL PRIMARY KEY, NAME VARCHAR, ZIP INTEGER) " + tableDDLOptions); conn.commit(); conn.createStatement().execute("CREATE VIEW " + viewFullName + " AS SELECT * FROM " + dataTableFullName); conn.commit(); conn.createStatement().execute("upsert into " + viewFullName + " values (1, 'Phoenix', 12345)"); conn.commit(); IndexRegionObserver.setIgnoreIndexRebuildForTesting(true); conn.createStatement().execute(String.format( "CREATE INDEX %s ON %s (NAME) INCLUDE (ZIP) ASYNC", indexTableName, viewFullName)); runIndexTool(directApi, useSnapshot, schemaName, viewName, indexTableName, null, -1, IndexTool.IndexVerifyType.AFTER); Cell cell = getErrorMessageFromIndexToolOutputTable(conn, dataTableFullName, "_IDX_" + dataTableFullName); try { String expectedErrorMsg = IndexRebuildRegionScanner.ERROR_MESSAGE_MISSING_INDEX_ROW_BEYOND_MAX_LOOKBACK; String actualErrorMsg = Bytes.toString(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength()); assertTrue(expectedErrorMsg.equals(actualErrorMsg)); } catch(Exception ex){ Assert.fail("Fail to parsing the error message from IndexToolOutputTable"); } IndexRegionObserver.setIgnoreIndexRebuildForTesting(false); dropIndexToolTables(conn); } }