1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
From: Dmitry Shachnev <mitya57@debian.org>
Date: Sat, 6 Apr 2024 22:23:07 +0300
Subject: Remove top-level .dirhash before running testUpdateNoChanges
During the first test (testBasicClone), some files inside dirB are
deleted or modified. This causes rebuild of dirB/.dirindex and
dirB/.dirhash, but does not update the top-level .dirhash.
That hash cache is only updated when the size or the last modified
time of dirB/.dirindex differs from the size or timestamp in the
.dirhash file. However, the size does not change in our case, and
the timestamp has granularity of one second, so if the test runs
quickly enough, the timestamps will match even after the contents of
dirB/.dirindex changed.
So testUpdateNoChanges was flaky: sometimes it passed, and sometimes
failed with "Bad request count" exception when comparing request
count for dirB. This change stabilizes it.
Forwarded: https://sourceforge.net/p/flightgear/simgear/merge-requests/127/
---
simgear/io/test_repository.cxx | 1 +
1 file changed, 1 insertion(+)
diff --git a/simgear/io/test_repository.cxx b/simgear/io/test_repository.cxx
index ad4e956..ca380f2 100644
--- a/simgear/io/test_repository.cxx
+++ b/simgear/io/test_repository.cxx
@@ -474,6 +474,7 @@ void testUpdateNoChanges(HTTP::Client* cl)
std::unique_ptr<HTTPRepository> repo;
SGPath p(simgear::Dir::current().path());
p.append("http_repo_basic"); // same as before
+ (p / ".dirhash").remove();
global_repo->clearRequestCounts();
|