diff --git a/.github/workflows/canary-integration-test.yml b/.github/workflows/canary-integration-test.yml index f45c29fc5..1c909792d 100644 --- a/.github/workflows/canary-integration-test.yml +++ b/.github/workflows/canary-integration-test.yml @@ -1924,6 +1924,9 @@ jobs: run: | tests/scripts/github-action-helper.sh wait_for cephcluster my-cluster rook-ceph tests/scripts/github-action-helper.sh wait_for cephcluster my-cluster rook-ceph-secondary + # wait for the RGW deployments to be ready to serve traffic + kubectl -n rook-ceph wait --for=condition=available deployment/rook-ceph-rgw-multisite-store-a --timeout=300s + kubectl -n rook-ceph-secondary wait --for=condition=available deployment/rook-ceph-rgw-zone-b-multisite-store-a --timeout=300s - name: write an object to one cluster, read from the other shell: bash --noprofile --norc -eo pipefail -x {0} diff --git a/tests/scripts/github-action-helper.sh b/tests/scripts/github-action-helper.sh index cbea506ca..9aa6400b4 100755 --- a/tests/scripts/github-action-helper.sh +++ b/tests/scripts/github-action-helper.sh @@ -610,6 +610,18 @@ function s3cmd() { command timeout 200 s3cmd -v --config=s3cfg --access_key="${S3CMD_ACCESS_KEY}" --secret_key="${S3CMD_SECRET_KEY}" "$@" } +function retry() { + local retries=$1; shift + local attempt + for (( attempt=1; attempt<=retries; attempt++ )); do + if "$@"; then return 0; fi + echo "$* failed (attempt ${attempt}/${retries}), retrying in 5s..." + sleep 5 + done + echo "$* failed after ${retries} attempts" + exit 1 +} + function write_object_read_from_replica_cluster() { local write_cluster_ip=${1?ip address of cluster to write to is required} local read_cluster_ip=${2?ip address of cluster to read from is required} @@ -621,8 +633,8 @@ function write_object_read_from_replica_cluster() { # ensure that test file has unique data echo "$test_object_name" >>"$test_object_name" - s3cmd --host="${write_cluster_ip}" mb "s3://${test_bucket_name}" - s3cmd --host="${write_cluster_ip}" put "$test_object_name" "s3://${test_bucket_name}" + retry 3 s3cmd --host="${write_cluster_ip}" mb "s3://${test_bucket_name}" + retry 3 s3cmd --host="${write_cluster_ip}" put "$test_object_name" "s3://${test_bucket_name}" # Schedule a signal for 60s into the future as a timeout on retrying s3cmd. # This voodoo is to avoid running everything under a new shell started by