From f88c3055f8b3786f0f95ffe26813d4f3cf093247 Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Costa Date: Sat, 18 Oct 2025 23:36:42 +0000 Subject: [PATCH] refactor(tests/nixos/s3-binary-cache-store): clean client store in setup_s3 Add cleanup of client store in the finally block of setup_s3 decorator. Uses `nix store delete --ignore-liveness` to properly handle GC roots and only attempts deletion if the path exists. --- tests/nixos/s3-binary-cache-store.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/nixos/s3-binary-cache-store.nix b/tests/nixos/s3-binary-cache-store.nix index e7fcadb45..68d123b51 100644 --- a/tests/nixos/s3-binary-cache-store.nix +++ b/tests/nixos/s3-binary-cache-store.nix @@ -139,6 +139,7 @@ in """ Decorator that creates/destroys a unique bucket for each test. Optionally pre-populates bucket with specified packages. + Cleans up client store after test completion. Args: populate_bucket: List of packages to upload before test runs @@ -155,6 +156,9 @@ in test_func(bucket) finally: server.succeed(f"mc rb --force minio/{bucket}") + # Clean up client store - only delete if path exists + for pkg in PKGS.values(): + client.succeed(f"[ ! -e {pkg} ] || nix store delete --ignore-liveness {pkg}") return wrapper return decorator