Added delay to flaky test that is caused by timestamp resolution being 1s

This commit is contained in:
Kenneth Skovhede
2026-06-22 19:38:22 +02:00
parent 9f0ccbe881
commit 7b02cb1232
+7
View File
@@ -120,6 +120,13 @@ namespace Duplicati.UnitTest
Assert.That(failed, Is.True, "Failed to trigger the dlist upload failure");
// Wait a moment to ensure the resumed backup's operation timestamp is
// strictly after the synthetic filelist timestamp created from the
// interrupted backup. Fileset filenames have one-second resolution, so
// a sub-second gap between backups can otherwise place the synthetic
// fileset timestamp ahead of the current operation timestamp.
await Task.Delay(TimeSpan.FromSeconds(1));
// Verify that dblock files were uploaded but no dlist exists
var dblockFilesAfterFail = Directory.EnumerateFiles(this.TARGETFOLDER, "*.dblock.*").ToList();
Assert.That(dblockFilesAfterFail.Count, Is.GreaterThan(0), "At least one dblock file should have been uploaded");