diff options
Diffstat (limited to 'src/zenserver/cache/structuredcachestore.cpp')
| -rw-r--r-- | src/zenserver/cache/structuredcachestore.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/zenserver/cache/structuredcachestore.cpp b/src/zenserver/cache/structuredcachestore.cpp index 786053adc..207323451 100644 --- a/src/zenserver/cache/structuredcachestore.cpp +++ b/src/zenserver/cache/structuredcachestore.cpp @@ -1123,7 +1123,15 @@ TEST_CASE("z$.gc") } } { + // GC could not remove the currently written block so size will not 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); } } |