Skip to content

test(Makefile): retry pulling postgres in test-postgres-docker #16178

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

Merged
merged 2 commits into from
Jan 17, 2025

Conversation

mafredri
Copy link
Member

@mafredri mafredri force-pushed the mafredri/chore-makefile-retry-pull-docks branch from 4814457 to 196d2af Compare January 17, 2025 14:32
@mafredri mafredri requested a review from johnstcn January 17, 2025 14:33
Makefile Outdated
Comment on lines 868 to 871
# Try pulling up to three times to avoid CI flakes.
docker pull gcr.io/coder-dev-1/postgres:${POSTGRES_VERSION} || \
docker pull gcr.io/coder-dev-1/postgres:${POSTGRES_VERSION} || \
docker pull gcr.io/coder-dev-1/postgres:${POSTGRES_VERSION}
Copy link
Member

Choose a reason for hiding this comment

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

That'd work, but maybe we could add a utility script that doe something like this:

# Try pulling up to three times to avoid CI flakes.
for attempt in {1..3}; do
	if [ ! docker pull gcr.io/coder-dev-1/postgres:${POSTGRES_VERSION} ]; then
	  echo "Failed to pull image, retrying...";
	  sleep 1;
	else
	  break;
	fi
done

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, that'd be nicer for sure, I was just lazy. I adapted it a bit to make sure we don't print retrying after we don't retry any more 👍🏻

@mafredri mafredri force-pushed the mafredri/chore-makefile-retry-pull-docks branch from d57941d to 220a38a Compare January 17, 2025 14:49
@mafredri mafredri enabled auto-merge (squash) January 17, 2025 14:51
Copy link
Contributor

@dannykopping dannykopping left a comment

Choose a reason for hiding this comment

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

LGTM

@mafredri mafredri merged commit 08ffcb7 into main Jan 17, 2025
34 checks passed
@mafredri mafredri deleted the mafredri/chore-makefile-retry-pull-docks branch January 17, 2025 15:22
@github-actions github-actions bot locked and limited conversation to collaborators Jan 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants