This is an automated email from the ASF dual-hosted git repository.

sadpandajoe pushed a commit to branch 
ultraset-ci-db2-testcontainer-image-pull-timeout
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 20a64bbeacf974fe2b7ca1bfbc6488a10cd42b8e
Author: Joe Li <[email protected]>
AuthorDate: Mon Nov 16 17:49:10 2026 +0000

    ci(testcontainers): pre-pull the Db2 image with a bounded retry
    
    testcontainers pulls icr.io/db2_community/db2 once, with no retry, and a
    single transient dial timeout to icr.io failed ~1.6% of db2 jobs before any
    test ran. Pull the fixture's own image first, retrying only the pull (3
    attempts, 30s/60s apart), and fail loudly if every attempt fails.
---
 .github/workflows/testcontainers.yml | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/.github/workflows/testcontainers.yml 
b/.github/workflows/testcontainers.yml
index d23823382be..9a34aaff2d9 100644
--- a/.github/workflows/testcontainers.yml
+++ b/.github/workflows/testcontainers.yml
@@ -165,6 +165,26 @@ jobs:
         run: |
           sudo apt-get update
           sudo apt-get install -y libfbclient2
+      - name: Pre-pull Db2 image
+        # testcontainers pulls the fixture's image only when it is missing
+        # locally, in a single attempt (neither it nor docker-py retries a
+        # pull), and one transient dial timeout to icr.io failed ~1.6% of
+        # db2 runs before any test ran. Pull it here instead, retrying only
+        # the pull; each ~30s dial timeout plus the 30s/60s wait spans
+        # icr.io's 60s DNS TTL, so a retry can reach a different address
+        # (it serves one rotating A record). The image name comes from
+        # Db2Container itself so it cannot drift from the fixture's.
+        if: matrix.dialect == 'db2'
+        run: |
+          image="$(python -c 'from testcontainers.community.db2 import 
Db2Container; print(Db2Container().image)')"
+          for delay in 30 60; do
+            docker pull "$image" && exit 0
+            echo "::warning::docker pull $image failed; retrying in ${delay}s"
+            sleep "$delay"
+          done
+          docker pull "$image" && exit 0
+          echo "::error::docker pull $image failed after 3 attempts"
+          exit 1
       - name: Run testcontainers db_engine_specs tests (${{ matrix.dialect }})
         # nightly_only dialects are already excluded from the matrix itself
         # on pull_request runs (see the compute-matrix job above), so this

Reply via email to