Skip to content

Commit

Permalink
e2e: make BuildImage parallel-safe
Browse files Browse the repository at this point in the history
"image rm concurrent" test is still failing, even after containers#18664:

    Error: no contents in "/tmp/podman_test967723851/Dockerfile"

Probable cause: the images are built in parallel, and p.BuildImage()
writes one single Dockerfile. (This almost certainly renders the
test less effective than intended, since the generated images
might end up being identical).

Solution: write and use a uniquely-named Dockerfile

Signed-off-by: Ed Santiago <santiago@redhat.com>
  • Loading branch information
edsantiago committed May 30, 2023
1 parent 0ab95af commit 24c50ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/e2e/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,7 @@ func (s *PodmanSessionIntegration) jq(jqCommand string) (string, error) {
}

func (p *PodmanTestIntegration) buildImage(dockerfile, imageName string, layers string, label string) string {
dockerfilePath := filepath.Join(p.TempDir, "Dockerfile")
dockerfilePath := filepath.Join(p.TempDir, "Dockerfile-" + stringid.GenerateRandomID())
err := os.WriteFile(dockerfilePath, []byte(dockerfile), 0755)
Expect(err).ToNot(HaveOccurred())
cmd := []string{"build", "--pull-never", "--layers=" + layers, "--file", dockerfilePath}
Expand Down

0 comments on commit 24c50ed

Please sign in to comment.