Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: create unique image tags for each test in order to avoid race conditions between tests #74

Merged
merged 2 commits into from
Dec 3, 2024

Conversation

korenyoni
Copy link
Member

@korenyoni korenyoni commented Dec 2, 2024

what

  • create unique image tags for each test in order to avoid race condititions

why

This assertion fails because of a race condition between the three tests in this repo.

For example, take a look at this renovate PR:

image

The manifest produced by each commit in the screenshot are as follows, in order from oldest to newest:

$ docker buildx imagetools inspect registry.hub.docker.com/cloudposse/github-action-docker-build-push:sha-61a55ff023a1813dca90b5ddc2becbb248ff79b9 --raw | jq '.manifests | map(select(.platform.architecture != "unknown") | .platform.os + "/" + .platform.architecture)'
[
  "linux/amd64",
  "linux/arm64"
]
$ docker buildx imagetools inspect registry.hub.docker.com/cloudposse/github-action-docker-build-push:sha-c5f9ccf5aad31e6d255ea1631a4dc2311d88452e --raw | jq '.manifests | map(select(.platform.architecture != "unknown") | .platform.os + "/" + .platform.architecture)'
[
  "linux/amd64"
]
$ docker buildx imagetools inspect registry.hub.docker.com/cloudposse/github-action-docker-build-push:sha-fd863042e23edb3cdea14cd459f4307ed2b29f3d --raw | jq '.manifests | map(select(.platform.architecture != "unknown") | .platform.os + "/" + .platform.architecture)'
[
  "linux/amd64",
  "linux/arm64"
]

As previously mentioned, there is a race condition between the three tests that get dispatched by this action. They all produce an image tag of sha-[sha]. That means that if the test-docker-build-multi-platform.yml build finishes before the test-docker-build.yml build, the multi-platform manifest will be overwritten by the single-platform image.

references

N/A

@korenyoni korenyoni added the bug 🐛 An issue with the system label Dec 2, 2024
@korenyoni korenyoni requested review from goruha and dudymas December 2, 2024 21:20
@korenyoni korenyoni changed the title fix: create unique image tags for each test in order to avoid race condititions fix: create unique image tags for each test in order to avoid race conditions between tests Dec 2, 2024
Copy link
Contributor

@dudymas dudymas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! thanks for finding this

@korenyoni korenyoni merged commit 8592b95 into main Dec 3, 2024
19 checks passed
@korenyoni korenyoni deleted the fix/unique-tags branch December 3, 2024 14:23
Copy link

github-actions bot commented Dec 3, 2024

These changes were released in v1.16.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An issue with the system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants