smengcl commented on code in PR #4657:
URL: https://github.com/apache/ozone/pull/4657#discussion_r1195789106
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshot.java:
##########
@@ -927,4 +890,104 @@ public void testSnapshotOpensWithDisabledAutoCompaction()
throws Exception {
}
}
+ // Test snapshot diff when OM restarts in non-HA OM env and diff job is
+ // in_progress when it restarts.
+ @Test
+ public void testSnapshotDiffWhenOmRestart()
+ throws IOException, InterruptedException {
+ String snapshot1 = "snap-" + RandomStringUtils.randomNumeric(5);
+ String snapshot2 = "snap-" + RandomStringUtils.randomNumeric(5);
+ createSnapshots(snapshot1, snapshot2);
+
+ SnapshotDiffResponse response = store.snapshotDiff(volumeName, bucketName,
+ snapshot1, snapshot2, null, 0, false);
+
+ assertEquals(IN_PROGRESS, response.getJobStatus());
+
+ // Restart the OM and wait for sometime to make sure that previous snapDiff
+ // job finishes.
+ cluster.restartOzoneManager();
+ await().atMost(Duration.ofSeconds(120)).
+ until(() -> cluster.getOzoneManager().isRunning());
+ Thread.sleep(1000L);
Review Comment:
Can we change this sleep into some conditional one like
`GenericTestUtils.waitFor()`? Otherwise this could be a source of flakiness on
slower machines like the Github action ones?
--
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]