From 10f9a8e77d504354deafbcf7351a6d46d4528542 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 15 Oct 2021 16:52:37 +0200 Subject: Add a test for the non-blocking GC --- src/libstore/gc.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') 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) { -- cgit v1.2.3