mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #20411 from aaronlehmann/strengthen-TestPullFromCentralRegistryImplicitRefParts
Improve resilience of TestPullFromCentralRegistryImplicitRefParts
This commit is contained in:
commit
e9234d8aaf
1 changed files with 17 additions and 0 deletions
|
@ -86,6 +86,23 @@ func (s *DockerHubPullSuite) TestPullFromCentralRegistryImplicitRefParts(c *chec
|
||||||
"index.docker.io/library/hello-world",
|
"index.docker.io/library/hello-world",
|
||||||
} {
|
} {
|
||||||
out := s.Cmd(c, "pull", i)
|
out := s.Cmd(c, "pull", i)
|
||||||
|
v1Retries := 0
|
||||||
|
for strings.Contains(out, "this image was pulled from a legacy registry") {
|
||||||
|
// Some network errors may cause fallbacks to the v1
|
||||||
|
// protocol, which would violate the test's assumption
|
||||||
|
// that it will get the same images. To make the test
|
||||||
|
// more robust against these network glitches, allow a
|
||||||
|
// few retries if we end up with a v1 pull.
|
||||||
|
|
||||||
|
if v1Retries > 2 {
|
||||||
|
c.Fatalf("too many v1 fallback incidents when pulling %s", i)
|
||||||
|
}
|
||||||
|
|
||||||
|
s.Cmd(c, "rmi", i)
|
||||||
|
out = s.Cmd(c, "pull", i)
|
||||||
|
|
||||||
|
v1Retries++
|
||||||
|
}
|
||||||
c.Assert(out, checker.Contains, "Image is up to date for hello-world:latest")
|
c.Assert(out, checker.Contains, "Image is up to date for hello-world:latest")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue