diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexToolForNonTxGlobalIndexIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexToolForNonTxGlobalIndexIT.java index 5bf5c905ce4..abadfa7f25e 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexToolForNonTxGlobalIndexIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexToolForNonTxGlobalIndexIT.java @@ -1367,9 +1367,13 @@ public void testIncrementalRebuildWithPageSize() throws Exception { conn.createStatement().execute("UPSERT INTO " + fullDataTableName + " VALUES('a','aa')"); conn.createStatement().execute("UPSERT INTO " + fullDataTableName + " VALUES('b','bb')"); conn.commit(); + // The table has no index yet, so the server does not keep batch timestamps apart. + // Each commit must use a new millisecond. Otherwise a delete masks the earlier put. + Thread.sleep(1); conn.createStatement().execute("DELETE FROM " + fullDataTableName + " WHERE k = 'a'"); conn.createStatement().execute("DELETE FROM " + fullDataTableName + " WHERE k = 'b'"); conn.commit(); + Thread.sleep(1); conn.createStatement().execute("UPSERT INTO " + fullDataTableName + " VALUES('a','aaa')"); conn.createStatement().execute("UPSERT INTO " + fullDataTableName + " VALUES('b','bbb')"); conn.createStatement().execute("DELETE FROM " + fullDataTableName + " WHERE k = 'c'");