You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "potiuk (via GitHub)" <gi...@apache.org> on 2026/06/25 10:55:49 UTC
[PR] Fix flaky CloudSQL custom-universe trigger test on loaded runners [airflow]
potiuk opened a new pull request, #68981:
URL: https://github.com/apache/airflow/pull/68981
### Problem
`test_async_export_trigger_executes_successfully_in_custom_universe` failed on the Non-DB providers job (Py3.14) with `Expected 'get_operation' to be called once. Called 0 times.`
The custom-universe branch of `CloudSQLExportTrigger.run()` fetches the operation via `sync_to_async(sync_hook.get_operation)`, which dispatches the call to a **thread-pool executor**. The test waited a fixed `await asyncio.sleep(0.1)` before asserting `get_operation` had been called — but on a loaded runner the thread-dispatched call can land slightly later, so the assertion intermittently saw it called 0 times. (The default-universe path doesn't hit this because it awaits the async hook directly in the event loop, no thread.)
### Fix
Poll until the call is observed instead of a fixed sleep. The trigger's `poke_interval` is 10s, so no second call can happen within the poll window and `assert_called_once` stays valid. Deterministic regardless of runner speed; breaks out as soon as the call lands.
Test-only; ran the trigger test class repeatedly locally to confirm.
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes — Claude Code (Opus 4.8)
Generated-by: Claude Code (Opus 4.8) 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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix flaky CloudSQL custom-universe trigger test on loaded runners [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk merged PR #68981:
URL: https://github.com/apache/airflow/pull/68981
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org