Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing the existence of a directory is very slow #326

Open
mattupstate opened this issue Dec 5, 2022 · 0 comments
Open

Testing the existence of a directory is very slow #326

mattupstate opened this issue Dec 5, 2022 · 0 comments

Comments

@mattupstate
Copy link

mattupstate commented Dec 5, 2022

When testing the existence of a directory it appears that if the directory contains many (nested) files, the test takes a considerable amount of time to complete. Is this expected? My assumption is that this test would complete quite quickly. For example, the following test takes 9 seconds to complete on my arm64 macOS 12.6.1 system against the community nginx image:

Test:

fileExistenceTests:
  - name: Root
    path: /
    shouldExist: true

Output (w/ time):

$ time container-structure-test -v debug test --image nginx --config container-structure.yaml
INFO[0000] container-structure-test &{Version:1.14.0 GitVersion: BuildDate:2022-11-22T13:04:18Z GoVersion:go1.19.3 Compiler:gc Platform:darwin/arm64}

=================================================
====== Test file: container-structure.yaml ======
=================================================
INFO[0000] File Existence Test: Root
DEBU[0009] Skipping empty metadata test
=== RUN: File Existence Test: Work dir exists
--- PASS
duration: 0s

=================================================
==================== RESULTS ====================
=================================================
Passes:      1
Failures:    0
Duration:    0s
Total tests: 1

PASS
container-structure-test -v debug test --image nginx --config   0.16s user 0.62s system 7% cpu 9.943 total
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

No branches or pull requests

1 participant