Skip to content

Commit f574628

Browse files
committed
test(backup): drop unnecessary PARENT_BACKUP_ID stub in sweep-pending-parent test
deletingLeafSweepsUpDeletePendingParent stubbed the leaf's PARENT_BACKUP_ID but production never reads it on this path: - findLiveChildren(leaf) iterates the sibling list and reads each *other* backup's PARENT_BACKUP_ID against leaf.getUuid() — never the leaf's own. - getChainOrderedLeafToRoot (introduced in 096bef1) walks the chain by CHAIN_ID + CHAIN_POSITION; the legacy findChainParent → PARENT_BACKUP_ID walk is bypassed for the sweep. Same UnnecessaryStubbingException pattern as 9f4d61f; the parent's PARENT_BACKUP_ID stub IS still used (findLiveChildren reads it) so it stays. Unblocks CI for #13074.
1 parent 4207ea9 commit f574628

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

plugins/backup/nas/src/test/java/org/apache/cloudstack/backup/NASBackupProviderTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,10 +596,8 @@ public void deletingLeafSweepsUpDeletePendingParent()
596596
// ordered chain — getChainOrderedLeafToRoot sorts by CHAIN_POSITION descending.
597597
BackupDetailVO leafChainId = new BackupDetailVO(51L, NASBackupChainKeys.CHAIN_ID, "chain-1", true);
598598
BackupDetailVO leafChainPos = new BackupDetailVO(51L, NASBackupChainKeys.CHAIN_POSITION, "1", true);
599-
BackupDetailVO leafParent = new BackupDetailVO(51L, NASBackupChainKeys.PARENT_BACKUP_ID, "parent-uuid", true);
600599
Mockito.when(backupDetailsDao.findDetail(51L, NASBackupChainKeys.CHAIN_ID)).thenReturn(leafChainId);
601600
Mockito.when(backupDetailsDao.findDetail(51L, NASBackupChainKeys.CHAIN_POSITION)).thenReturn(leafChainPos);
602-
Mockito.when(backupDetailsDao.findDetail(51L, NASBackupChainKeys.PARENT_BACKUP_ID)).thenReturn(leafParent);
603601

604602
// Parent is the tombstoned full anchor (CHAIN_POSITION=0).
605603
BackupDetailVO parentChainId = new BackupDetailVO(50L, NASBackupChainKeys.CHAIN_ID, "chain-1", true);

0 commit comments

Comments
 (0)