Add image pull concurrency limit.

Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
Lantao Liu
2019-01-09 13:30:12 -08:00
parent 5abeeff84f
commit d7ed403072
10 changed files with 196 additions and 9 deletions

View File

@@ -327,6 +327,23 @@ func TestImagePullSchema1(t *testing.T) {
}
}
func TestImagePullWithConcurrencyLimit(t *testing.T) {
client, err := newClient(t, address)
if err != nil {
t.Fatal(err)
}
defer client.Close()
ctx, cancel := testContext()
defer cancel()
_, err = client.Pull(ctx, testImage,
WithPlatformMatcher(platforms.Default()),
WithMaxConcurrentDownloads(2))
if err != nil {
t.Fatal(err)
}
}
func TestClientReconnect(t *testing.T) {
t.Parallel()