meel-ayush opened a new pull request, #76912:
URL: https://github.com/apache/airflow/pull/76912

   ### Description
   
   When `get_schema_k8s()` in 
`chart/tests/chart_utils/helm_template_generator.py` downloads Kubernetes JSON 
validation schemas over the network from `airflow.apache.org`, transient TLS 
handshake timeouts or TCP socket resets cause an unhandled `URLError` and fail 
otherwise passing test runs.
   
   During parallel test execution with `pytest -n 4`, momentary network stalls 
exceeding the 30-second socket timeout fail the entire 10-minute Helm test run.
   
   The fix wraps `urlopen` in an exponential backoff retry loop (up to 3 
attempts with 1.0s and 2.0s delays) that catches transient socket and network 
errors (`URLError`, `TimeoutError`, `OSError`, and non-404 `HTTPError`s). 
Deterministic schema missing conditions (`HTTPError` 404) continue to 
immediately raise `FileNotFoundError` without retrying.
   
   ### Tests
   
   - Added `chart/tests/helm_tests/airflow_aux/test_helm_template_generator.py` 
covering:
     - First-attempt retrieval success.
     - Retrying transient network errors (`URLError`, `TimeoutError`, 
`OSError`, and `HTTPError` 503).
     - Terminal failure after exhausting 3 attempts.
     - Immediate `FileNotFoundError` fast-failure on HTTP 404 without retrying.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [ ] Yes (please specify the tool below)


-- 
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]

  • [PR] Helm: Retry transient ne... meel-ayush (via GitHub) via commits

Reply via email to