Skip to content

Commit 9b81bd1

Browse files
committed
add retries
1 parent 6102651 commit 9b81bd1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.evergreen/utils.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,22 @@ is_python_310() {
5252
}
5353

5454

55+
retry() {
56+
for i in 1 2 4 8 16; do
57+
{ "$@" && return 0; } || sleep $i
58+
done
59+
return 1
60+
}
61+
62+
5563
# start mongodb-atlas-local container, because of a bug in podman we have to define the healtcheck ourselves (is the same as in the image)
5664
# stores the connection string in .local_atlas_uri file
5765
setup_local_atlas() {
5866
echo "Starting the container"
67+
68+
IMAGE=mongodb/mongodb-atlas-local:latest
69+
retry podman pull $IMAGE
70+
5971
CONTAINER_ID=$(podman run --rm -d -e DO_NOT_TRACK=1 -P --health-cmd "/usr/local/bin/runner healthcheck" mongodb/mongodb-atlas-local:latest)
6072

6173
echo "waiting for container to become healthy..."

0 commit comments

Comments
 (0)