diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2025-06-12 10:39:46 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2025-06-12 17:07:17 +0200 |
commit | 826cfa2022fbce7c3bf22b23b335f2080d878eaa (patch) | |
tree | c99b0a7ea1c46b762acbad30ab70c64b0c93eb30 /test | |
parent | 4e0068a7e650ca9fb03e9c1a28dddcf1ddf2345c (diff) | |
download | justbuild-826cfa2022fbce7c3bf22b23b335f2080d878eaa.tar.gz |
GarbageCollector: Support removal of all generations at once
...that ignores compactification.
Diffstat (limited to 'test')
-rw-r--r-- | test/buildtool/storage/large_object_cas.test.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/buildtool/storage/large_object_cas.test.cpp b/test/buildtool/storage/large_object_cas.test.cpp index 9de22e9b..ce6fe7e5 100644 --- a/test/buildtool/storage/large_object_cas.test.cpp +++ b/test/buildtool/storage/large_object_cas.test.cpp @@ -526,6 +526,30 @@ TEST_CASE("LocalCAS: Split-Splice", "[storage]") { } } +TEST_CASE("Skip compactification", "[storage]") { + auto const config = TestStorageConfig::Create(); + auto const storage = Storage::Create(&config.Get()); + + auto const& cas = storage.CAS(); + + // Create a large object in CAS: + using LargeTestUtils::File; + auto object = File::Create(cas, File::kLargeId, File::kLargeSize); + REQUIRE(object.has_value()); + auto& [digest, path] = *object; + REQUIRE(cas.BlobPath(digest, /*is_executable=*/false).has_value()); + + // Trigger garbage collection with --all + REQUIRE(GarbageCollector::TriggerGarbageCollection( + config.Get(), /*no_rotation=*/false, /*gc_all=*/true)); + + // Check no generation remains: + for (std::size_t i = 0; i < config.Get().num_generations; ++i) { + CHECK_FALSE( + FileSystemManager::Exists(config.Get().GenerationCacheRoot(i))); + } +} + // Test uplinking of nested large objects: // A large tree depends on a number of nested objects: // |