Skip to content

tar driver: add --cache-dir to reuse the extracted filesystem across tests - #567

Closed
yuriipolishchuk wants to merge 1 commit into
GoogleContainerTools:mainfrom
yuriipolishchuk:tar-driver-cache-dir
Closed

tar driver: add --cache-dir to reuse the extracted filesystem across tests#567
yuriipolishchuk wants to merge 1 commit into
GoogleContainerTools:mainfrom
yuriipolishchuk:tar-driver-cache-dir

Conversation

@yuriipolishchuk

Copy link
Copy Markdown

Fixes #86. Also resolves the slowness reported in #326.

The tar driver creates a new driver per test, and each one extracts the full image filesystem into a fresh random temp dir. The cache plumbing to avoid this already exists (getExtractPathForName + the DirIsEmpty reuse check in GetFileSystemForImage) but nothing wires it up: GetImageForName hardcodes an empty cacheDir.

This adds a --cache-dir flag that threads through to the tar driver. The extraction path is keyed by image name/digest under the cache dir, so different images sharing a dir cannot reuse each other's filesystem. Combine with --save so per-test Destroy() keeps the extraction. Default behavior (no flag) is unchanged.

Benchmark (634MB image, 19 fileExistenceTests, --driver tar):

wall time extractions
without --cache-dir 3m13s 19
with --save --cache-dir 14s 1 (+18 cache reuses)

Identical test verdicts in both runs.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@google-cla

google-cla Bot commented Jul 31, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add mode to persist driver between test runs to avoid recreating filesystem

1 participant