potiuk opened a new pull request, #67066: URL: https://github.com/apache/airflow/pull/67066
The `Low dep tests: providers` mongo job is occasionally flaky on ARM CI — every `TestMongoHook` test errors at `setup_method` with: ``` pymongo.errors.ServerSelectionTimeoutError: 172.17.0.1:32769: [Errno 111] Connection refused ``` while the same SHA passes on the other parallel runs (e.g. mongo-3.11 failed in run [25978857524](https://github.com/apache/airflow/actions/runs/25978857524/job/76374215829#step:8:1) while every other mongo slot on that SHA was green). **Root cause:** under `uv --resolution lowest-direct`, `testcontainers` is pinned at the floor (`4.12.0`). `MongoDbContainer.start()` only waits for the `"waiting for connections"` log line, and mongod can emit that line a few milliseconds before the TCP listener is actually accepting on the published port. The fixture yielded `get_connection_url()` immediately after `start()` returned, so the first hook setup hit a closed port. No testcontainers version on PyPI closes that gap — `testcontainers 4.13.2` only made the log regex case-insensitive for legacy mongo 3.6 images (see [testcontainers-python#783](https://github.com/testcontainers/testcontainers-python/pull/783)), which doesn't help mongo:8.0. The reliable fix is in our own conftest. **Fix:** after `container.start()` succeeds, actively ping mongod with `pymongo.MongoClient.admin.command("ping")` retried for up to 60 s, then yield. All dependent fixtures now see a mongod that genuinely accepts connections. Observed failing CI job: https://github.com/apache/airflow/actions/runs/25978857524/job/76374215829 --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — Claude Opus 4.7 (1M context) Generated-by: Claude Opus 4.7 (1M context) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
