diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
index b30a3ed1..c1acd1c9 100644
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -20,6 +20,11 @@ jobs:
           COUCHDB_USER: admin
           COUCHDB_PASSWORD: abc123
         image: couchdb:2.2.0
+        options: >
+          --health-cmd "curl -sSf http://localhost:5984/_up"
+          --health-interval=10s
+          --health-timeout=5s
+          --health-retries=5
     steps:
       - uses: actions/checkout@v4
       - name: Set up Go
@@ -30,7 +35,10 @@ jobs:
       - name: Prepare CouchDB
         run: |
           export KIVIK_TEST_DSN_COUCH22=http://${COUCHDB_USER}:${COUCHDB_PASSWORD}@couchdb:5984/
-          sleep 60
+          while ! curl -sSf http://couchdb:5984/; do
+            echo "Waiting for CouchDB to be ready..."
+            sleep 5
+          done
           ./script/complete_couch2.sh ${KIVIK_TEST_DSN_COUCH22}
       - name: Run tests
         run: |