Skip to content

Commit 698758d

Browse files
committed
Fix backup rotation test for weekly backups
Adjust test to create backups starting from 1 day ago instead of 'now' to ensure all backups fall within the weekly retention window when KeepAllForHours and KeepDailyForDays are both 0.
1 parent ff419db commit 698758d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

LocalizationManager.Tests/UnitTests/Backup/BackupRotationPolicyTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,10 @@ public async Task ApplyRotationAsync_KeepsWeeklyBackups()
175175
var backups = new List<BackupMetadata>();
176176

177177
// Create backups for 4 weeks (one per week)
178+
// Start from 1 day ago to ensure all backups are clearly in the past
178179
for (int i = 0; i < 4; i++)
179180
{
180-
backups.Add(CreateBackup(i + 1, now.AddDays(-i * 7)));
181+
backups.Add(CreateBackup(i + 1, now.AddDays(-1 - i * 7)));
181182
}
182183

183184
var manifest = new BackupManifest

0 commit comments

Comments
 (0)