Skip to content

Commit f88c305

Browse files
committed
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.
1 parent 9058d90 commit f88c305

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/nixos/s3-binary-cache-store.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ in
139139
"""
140140
Decorator that creates/destroys a unique bucket for each test.
141141
Optionally pre-populates bucket with specified packages.
142+
Cleans up client store after test completion.
142143
143144
Args:
144145
populate_bucket: List of packages to upload before test runs
@@ -155,6 +156,9 @@ in
155156
test_func(bucket)
156157
finally:
157158
server.succeed(f"mc rb --force minio/{bucket}")
159+
# Clean up client store - only delete if path exists
160+
for pkg in PKGS.values():
161+
client.succeed(f"[ ! -e {pkg} ] || nix store delete --ignore-liveness {pkg}")
158162
return wrapper
159163
return decorator
160164

0 commit comments

Comments
 (0)