Merge pull request #14475 from vrothberg/fix-14468

test/e2e/save_test.go: fix flake
This commit is contained in:
OpenShift Merge Robot 2022-06-03 10:04:47 -04:00 committed by GitHub
commit 8f79604864
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -226,13 +226,17 @@ default-docker:
})
It("podman save --multi-image-archive (untagged images)", func() {
// Refer to images via ID instead of tag.
session := podmanTest.Podman([]string{"images", "--format", "{{.ID}}"})
// #14468: to make execution time more predictable, save at
// most three images and sort them by size.
session := podmanTest.Podman([]string{"images", "--sort", "size", "--format", "{{.ID}}"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
ids := session.OutputToStringArray()
Expect(len(ids)).To(BeNumerically(">", 1), "We need to have *some* images to save")
if len(ids) > 3 {
ids = ids[:3]
}
multiImageSave(podmanTest, ids)
})
})