This is an automated email from the ASF dual-hosted git repository.
jojochuang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git
The following commit(s) were added to refs/heads/master by this push:
new e80d51efdb7 HDDS-16170. Intermittent failure in
TestSnapshotDiffManager#testLoadJobsOnStartUp (#11014)
e80d51efdb7 is described below
commit e80d51efdb761ae5aee26a8cb03036dcd02cea52
Author: Siyao Meng <[email protected]>
AuthorDate: Mon Aug 24 17:17:05 2026 -0700
HDDS-16170. Intermittent failure in
TestSnapshotDiffManager#testLoadJobsOnStartUp (#11014)
Generated-by: Claude Opus 4.8 (1M context) <[email protected]>
---
.../ozone/om/snapshot/TestSnapshotDiffManager.java | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git
a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestSnapshotDiffManager.java
b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestSnapshotDiffManager.java
index 14fc35756e6..f391125fe06 100644
---
a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestSnapshotDiffManager.java
+++
b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestSnapshotDiffManager.java
@@ -1135,14 +1135,17 @@ public void testLoadJobsOnStartUp() throws Exception {
spy.loadJobsOnStartUp();
- // Wait for sometime to make sure that job finishes.
- attempt(() ->
- verify(spy, atLeast(1))
- .generateSnapshotDiffReport(anyString(), anyString(),
- eq(VOLUME_NAME), eq(BUCKET_NAME), eq(snapshotInfo.getName()),
- eq(snapshotInfoList.get(1).getName()), eq(false),
- eq(false)),
- 10, TimeDuration.ONE_SECOND, null, null);
+ // Wait until the job's status is persisted as DONE. Mockito records the
+ // invocation before running the stubbed answer, so waiting on verify(...)
+ // alone can return while the answer is still executing and has not yet
+ // written DONE to the DB, leaving the read below to observe IN_PROGRESS.
+ attempt(() -> {
+ if (getSnapshotDiffJobFromDb(snapshotInfo, snapshotInfoList.get(1))
+ .getStatus() != DONE) {
+ throw new IllegalStateException("Snapshot diff job is not DONE yet.");
+ }
+ return null;
+ }, 10, TimeDuration.ONE_SECOND, null, null);
SnapshotDiffJob snapDiffJob = getSnapshotDiffJobFromDb(snapshotInfo,
snapshotInfoList.get(1));
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]