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

testutil: optimization for mirror handling #5141

Merged
merged 2 commits into from
Jul 10, 2024

Conversation

tonistiigi
Copy link
Member

  • Instead of running a mirror for each integration.Run call,
    only run it if there is actual sandboxed test running. This speeds
    up running tests with a filter as if all the tests from a given
    suite are inactive, no time is spent running the mirror.
  • ProviderFromRef call is already making the HEAD request
    to upstream registry to get digest. Avoid doing that if
    image already exists in mirror anyway.

Before:

--- PASS: TestIntegration (6.46s)
    --- PASS: TestIntegration/TestHistoryError/worker=containerd-1.6/frontend=builtin (0.40s)
PASS
ok      github.com/moby/buildkit/frontend/dockerfile    6.872s

After:

--- PASS: TestIntegration (0.39s)
    --- PASS: TestIntegration/TestHistoryError/worker=containerd-1.6/frontend=builtin (0.36s)
PASS
ok      github.com/moby/buildkit/frontend/dockerfile    0.406s

Instead of running a mirror for each `integration.Run` call,
only run it if there is actual sandboxed test running. This speeds
up running tests with a filter as if all the tests from a given
suite are inactive, no time is spent running the mirror.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
ProviderFromRef call is already making the HEAD request
to upstream registry to get digest. Avoid doing that if
image already exists in mirror anyway.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
@AkihiroSuda AkihiroSuda merged commit e38c064 into moby:master Jul 10, 2024
76 checks passed
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.

2 participants