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

bugraoz93 pushed a commit to branch v3-2-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/v3-2-test by this push:
     new fe01a1eb981 [v3-2-test] Fix flaky e2e remote-logging tests: create 
LocalStack buckets via loopback (#67976) (#67981)
fe01a1eb981 is described below

commit fe01a1eb981d97b45de719d13f31f9476f553dea
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Thu Jun 4 00:55:58 2026 +0200

    [v3-2-test] Fix flaky e2e remote-logging tests: create LocalStack buckets 
via loopback (#67976) (#67981)
    
    The remote-logging and XCom object-storage e2e tests intermittently failed
    with NoSuchBucket because the LocalStack init hook never created the 
buckets.
    
    init-aws.sh runs inside the localstack container, but connected to the 
docker
    compose service name (http://localstack:4566), which is not reliably
    connectable from within the container at the READY-hook stage. When it 
failed,
    'aws s3 mb' exited non-zero and the buckets were never created, so worker
    PutObject calls returned NoSuchBucket.
    
    Connect over loopback (http://localhost:4566) instead, and add a short
    readiness wait with 'set -euo pipefail' so a transient gateway delay cannot
    silently leave the buckets uncreated.
    (cherry picked from commit 23adbdeae3d77eeaebcc9858f9655067b69f6ae3)
    
    Co-authored-by: Jarek Potiuk <[email protected]>
---
 airflow-e2e-tests/scripts/init-aws.sh | 26 +++++++++++++++++++++++---
 1 file changed, 23 insertions(+), 3 deletions(-)

diff --git a/airflow-e2e-tests/scripts/init-aws.sh 
b/airflow-e2e-tests/scripts/init-aws.sh
index 4c78d873570..b9b04198c0b 100755
--- a/airflow-e2e-tests/scripts/init-aws.sh
+++ b/airflow-e2e-tests/scripts/init-aws.sh
@@ -16,6 +16,26 @@
 # specific language governing permissions and limitations
 # under the License.
 
-aws --endpoint-url=http://localstack:4566 s3 mb s3://test-airflow-logs
-aws --endpoint-url=http://localstack:4566 s3 mb 
s3://test-xcom-objectstorage-backend
-aws --endpoint-url=http://localstack:4566 s3 ls
+set -euo pipefail
+
+# This script runs as a LocalStack READY init hook *inside* the localstack
+# container, so it must reach the gateway over loopback (localhost), not via 
the
+# docker compose service name "localstack" — the service-name endpoint is not
+# reliably resolvable/connectable from within the container at the READY stage
+# and intermittently caused "Could not connect to the endpoint URL" failures,
+# leaving the buckets uncreated and remote-logging tests failing with 
NoSuchBucket.
+endpoint_url="http://localhost:4566";
+
+# The READY hook fires when LocalStack reports ready, but guard against a
+# transient gateway delay so bucket creation never silently fails.
+for _ in $(seq 1 30); do
+  if aws --endpoint-url="${endpoint_url}" s3 ls >/dev/null 2>&1; then
+    break
+  fi
+  echo "Waiting for LocalStack S3 gateway at ${endpoint_url} ..."
+  sleep 1
+done
+
+aws --endpoint-url="${endpoint_url}" s3 mb s3://test-airflow-logs
+aws --endpoint-url="${endpoint_url}" s3 mb s3://test-xcom-objectstorage-backend
+aws --endpoint-url="${endpoint_url}" s3 ls

Reply via email to