mirror of
https://github.com/NixOS/nix.git
synced 2025-11-08 19:46:02 +01:00
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.
This commit is contained in:
parent
9058d90ab2
commit
f88c3055f8
1 changed files with 4 additions and 0 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue