diff --git a/fe/fe-core/src/test/java/com/starrocks/transaction/GtidGeneratorTest.java b/fe/fe-core/src/test/java/com/starrocks/transaction/GtidGeneratorTest.java index 132504a8de223..359498f1f880c 100644 --- a/fe/fe-core/src/test/java/com/starrocks/transaction/GtidGeneratorTest.java +++ b/fe/fe-core/src/test/java/com/starrocks/transaction/GtidGeneratorTest.java @@ -34,8 +34,10 @@ public void testNextGtidIncrementsSequenceOnSameMillisecond() { long secondGtid = gtidGenerator.nextGtid(); Assertions.assertNotEquals(firstGtid, secondGtid, "GTIDs should be unique"); - Assertions.assertEquals((firstGtid & GtidGenerator.MAX_SEQUENCE) + 1, secondGtid & GtidGenerator.MAX_SEQUENCE, - "Sequence should increment by 1 on the same millisecond"); + if (firstGtid >> GtidGenerator.TIMESTAMP_SHIFT == secondGtid >> GtidGenerator.TIMESTAMP_SHIFT) { + Assertions.assertEquals((firstGtid & GtidGenerator.MAX_SEQUENCE) + 1, secondGtid & GtidGenerator.MAX_SEQUENCE, + "Sequence should increment by 1 on the same millisecond"); + } } @Test