aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2021-10-15 16:52:37 +0200
committerEelco Dolstra <edolstra@gmail.com>2021-10-15 16:52:37 +0200
commit10f9a8e77d504354deafbcf7351a6d46d4528542 (patch)
tree27989dea7b8e87e31a32b3f1bae161176f39b06f /src
parentac54c6faa6b73c3da180dec666fadd6e8d7d18e3 (diff)
Add a test for the non-blocking GC
Diffstat (limited to 'src')
-rw-r--r--src/libstore/gc.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc
index 648295684..5e8cbf8fc 100644
--- a/src/libstore/gc.cc
+++ b/src/libstore/gc.cc
@@ -735,6 +735,10 @@ void LocalStore::collectGarbage(const GCOptions & options, GCResults & results)
}
};
+ /* Synchronisation point for testing, see tests/gc-concurrent.sh. */
+ if (auto p = getEnv("_NIX_TEST_GC_SYNC"))
+ readFile(*p);
+
/* Either delete all garbage paths, or just the specified
paths (for gcDeleteSpecific). */
if (options.action == GCOptions::gcDeleteSpecific) {