mirror of
https://github.com/containers/podman.git
synced 2025-06-24 03:08:13 +08:00
Merge pull request #20458 from edsantiago/retry_cache_pulls
ginkgo setup: retry cache pulls
This commit is contained in:
@ -412,9 +412,19 @@ func (p *PodmanTestIntegration) createArtifact(image string) {
|
|||||||
destName := imageTarPath(image)
|
destName := imageTarPath(image)
|
||||||
if _, err := os.Stat(destName); os.IsNotExist(err) {
|
if _, err := os.Stat(destName); os.IsNotExist(err) {
|
||||||
GinkgoWriter.Printf("Caching %s at %s...\n", image, destName)
|
GinkgoWriter.Printf("Caching %s at %s...\n", image, destName)
|
||||||
pull := p.PodmanNoCache([]string{"pull", image})
|
for try := 0; try < 3; try++ {
|
||||||
pull.Wait(440)
|
pull := p.PodmanNoCache([]string{"pull", image})
|
||||||
Expect(pull).Should(Exit(0))
|
pull.Wait(440)
|
||||||
|
if pull.ExitCode() == 0 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
if try == 2 {
|
||||||
|
Expect(pull).Should(Exit(0), "Failed after many retries")
|
||||||
|
}
|
||||||
|
|
||||||
|
GinkgoWriter.Println("Will wait and retry")
|
||||||
|
time.Sleep(time.Duration(try+1) * 5 * time.Second)
|
||||||
|
}
|
||||||
|
|
||||||
save := p.PodmanNoCache([]string{"save", "-o", destName, image})
|
save := p.PodmanNoCache([]string{"save", "-o", destName, image})
|
||||||
save.Wait(90)
|
save.Wait(90)
|
||||||
|
Reference in New Issue
Block a user