mirror of
https://github.com/containers/podman.git
synced 2025-06-24 03:08:13 +08:00
test/e2e/save_test.go: fix flake
Save at most three images and sort them by size. The test started to flake as _all_ local images were saved which is not neccessary. Fixes: #14468 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
@ -226,13 +226,17 @@ default-docker:
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("podman save --multi-image-archive (untagged images)", func() {
|
It("podman save --multi-image-archive (untagged images)", func() {
|
||||||
// Refer to images via ID instead of tag.
|
// #14468: to make execution time more predictable, save at
|
||||||
session := podmanTest.Podman([]string{"images", "--format", "{{.ID}}"})
|
// most three images and sort them by size.
|
||||||
|
session := podmanTest.Podman([]string{"images", "--sort", "size", "--format", "{{.ID}}"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(Exit(0))
|
||||||
ids := session.OutputToStringArray()
|
ids := session.OutputToStringArray()
|
||||||
|
|
||||||
Expect(len(ids)).To(BeNumerically(">", 1), "We need to have *some* images to save")
|
Expect(len(ids)).To(BeNumerically(">", 1), "We need to have *some* images to save")
|
||||||
|
if len(ids) > 3 {
|
||||||
|
ids = ids[:3]
|
||||||
|
}
|
||||||
multiImageSave(podmanTest, ids)
|
multiImageSave(podmanTest, ids)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user