Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/duplicati/duplicati.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Skovhede <kenneth@hexad.dk>2021-03-08 13:53:13 +0300
committerKenneth Skovhede <kenneth@hexad.dk>2021-03-08 13:53:13 +0300
commit88a1ec59c32ab721adee5e0d4061ff1e3c930b5d (patch)
tree4f1f25780a87691967bcfb0715bdaf7a4b5583fc /Duplicati/UnitTest/PurgeTesting.cs
parentf145b9fcc2f93aaa606bc939373afbb566034647 (diff)
Added delay to purge-broken-files unittest.
Since the repair introduces artifical filelists, there is sometimes a race in CI where the purge is faster than a second causing the time sequences to not line up during testing.
Diffstat (limited to 'Duplicati/UnitTest/PurgeTesting.cs')
-rw-r--r--Duplicati/UnitTest/PurgeTesting.cs7
1 files changed, 7 insertions, 0 deletions
diff --git a/Duplicati/UnitTest/PurgeTesting.cs b/Duplicati/UnitTest/PurgeTesting.cs
index d35d3dc1e..97954e5a5 100644
--- a/Duplicati/UnitTest/PurgeTesting.cs
+++ b/Duplicati/UnitTest/PurgeTesting.cs
@@ -233,6 +233,7 @@ namespace Duplicati.UnitTest
}
File.Delete(dblock_file);
+ var last_ts = DateTime.Now;
long[] affectedfiles;
@@ -285,6 +286,12 @@ namespace Duplicati.UnitTest
Assert.AreEqual(3, modFilesets);
}
+
+ // Since we make the operations back-to-back, the purge timestamp can drift beyond the current time
+ var wait_target = last_ts.AddSeconds(10) - DateTime.Now;
+ if (wait_target.TotalMilliseconds > 0)
+ System.Threading.Thread.Sleep(wait_target);
+
// A subsequent backup should be successful.
using (Controller c = new Controller("file://" + this.TARGETFOLDER, testopts, null))
{