diff options
Diffstat (limited to 'src/zenserver/cache/structuredcachestore.cpp')
| -rw-r--r-- | src/zenserver/cache/structuredcachestore.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/zenserver/cache/structuredcachestore.cpp b/src/zenserver/cache/structuredcachestore.cpp index 207323451..77316a5dc 100644 --- a/src/zenserver/cache/structuredcachestore.cpp +++ b/src/zenserver/cache/structuredcachestore.cpp @@ -1120,18 +1120,13 @@ TEST_CASE("z$.gc") const bool Exists = Zcs.Get(Bucket, Key, CacheValue); CHECK(!Exists); } + // GC could not remove the currently written block so size will not be zero + CHECK_NE(0, Zcs.StorageSize().DiskSize); } } { - // GC could not remove the currently written block so size will not be zero + // Unreferenced blocks will be pruned so size should now be zero ZenCacheNamespace Zcs(Gc, *JobQueue, TempDir.Path() / "cache", true); - CHECK_NE(0, Zcs.StorageSize().DiskSize); - - // GC again and now the stray write block should be removed - GcContext GcCtx(GcClock::Now() + std::chrono::minutes(2), GcClock::Now() + std::chrono::minutes(2)); - GcCtx.CollectSmallObjects(true); - Gc.CollectGarbage(GcCtx); - CHECK_EQ(0, Zcs.StorageSize().DiskSize); } } |