F64116045 commented on code in PR #11319:
URL: https://github.com/apache/ozone/pull/11319#discussion_r4119775437
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestContainerStateMachine.java:
##########
@@ -209,13 +214,25 @@ public void testRatisSnapshotRetention() throws Exception
{
key.write(("ratis" + i).getBytes(UTF_8));
}
}
+ waitForSnapshotAfter(storage, lastAppliedIndex);
+
files = parentPath.toFile().listFiles();
assertThat(files).isNotNull();
numSnapshots = files.length;
assertThat(Math.abs(ratisServerConfiguration.getNumSnapshotsRetained() -
numSnapshots))
.isLessThanOrEqualTo(1);
}
+ private static void waitForSnapshotAfter(SimpleStateMachineStorage storage,
+ long index) throws Exception {
+ CheckedSupplier<Boolean, IOException> snapshotAdvanced = () -> {
+ SingleFileSnapshotInfo snapshot =
+ StatemachineImplTestUtil.findLatestSnapshot(storage);
+ return snapshot != null && snapshot.getTermIndex().getIndex() > index;
+ };
+ GenericTestUtils.waitFor(snapshotAdvanced, 100, 30_000);
+ }
Review Comment:
Thanks, updated the polling condition
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]