[UT] Fix unstable cluster snapshot test (#63886)

Signed-off-by: srlch <linzichao@starrocks.com>
This commit is contained in:
srlch 2025-10-10 18:27:41 +08:00 committed by GitHub
parent 6f69933e11
commit af76406358
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 4 deletions

View File

@ -444,7 +444,7 @@ public class ClusterSnapshotTest {
final ClusterSnapshotMgr localClusterSnapshotMgr = new ClusterSnapshotMgr();
final CheckpointController feController = new CheckpointController("fe", new BDBJEJournal(null, ""), "");
final CheckpointController starMgrController = new CheckpointController("starMgr", new BDBJEJournal(null, ""), "");
final ClusterSnapshotInfo info = new ClusterSnapshotInfo(null);
final ClusterSnapshotInfo info = new ClusterSnapshotInfo(new HashMap<>());
ClusterSnapshotJob job = localClusterSnapshotMgr.createAutomatedSnapshotJob();
Assertions.assertTrue(!job.needClusterSnapshotInfo());
Assertions.assertTrue(job.isAutomated());
@ -481,9 +481,7 @@ public class ClusterSnapshotTest {
new MockUp<GlobalStateCheckpointWorker>() {
@Mock
void doCheckpoint(long epoch, long journalId, boolean needClusterSnapshotInfo) throws Exception {
if (needClusterSnapshotInfo) {
Deencapsulation.setField(info, "dbInfos", new HashMap<>());
}
Deencapsulation.setField(info, "dbInfos", new HashMap<>());
}
};