Repository navigation
TST: Handle external OPeNDAP outages in network tests - #11717
senanurcetin wants to merge 13 commits into
Conversation
Use email.message.Message headers for test HTTPError instances. Addresses Python 3.12 and 3.14 mypy arg-type failures.
Prevent unclosed HTTPError ResourceWarnings when external DAP endpoints return 503.
Exercise resource cleanup for HTTP 502, 503, and 504.
|
As discussed here: #11660 (comment) this is currently by design. So I think this direction is not the correct one, ideally we would make yourself independent of pydap test servers. |
|
Btw, I reported the outage here: OPENDAP/test.opendap.org#8 but nobody seems to be looking at that, no idea where the correct place is to ask for help. |
|
@headtr1ck Thanks for clarifying. I agree that skipping these tests when the server is unavailable could hide a persistent problem, especially since the flaky tests are already non-blocking. I'll reconsider the approach and investigate using local, self-contained PyDAP fixtures instead of relying on the external test server. I also understand the suggestion to move protocol-level integration coverage upstream to PyDAP. Would replacing the external dependency with local fixtures be an appropriate direction for a revised PR? |
cc @Mikejmnez |
|
Forgot to mention that I created #11718. |
Description
This PR improves the reliability of xarray's PyDAP network integration tests when the external OPeNDAP test server (
test.opendap.org) is temporarily unavailable.Problem
Some network tests depend on datasets hosted by
test.opendap.org.When the external server returns HTTP 503 responses or refuses connections, these tests fail with
urllib3.exceptions.MaxRetryErrorandrequests.exceptions.RetryError, even when the xarray implementation is unchanged.This behavior was observed in the Python 3.14 CI job associated with #11713, where six backend tests failed because of external OPeNDAP connection errors.
xref: #11718
Changes
Scope
The changes are limited to four test files:
xarray/tests/backends/conftest.pyxarray/tests/backends/test_pydap.pyxarray/tests/backends/test_datatree.pyxarray/tests/backends/test_opendap_availability.pyNo public APIs or production backend implementations are modified.
Testing
The added unit tests cover the availability checks and their handling of transient versus unexpected failures.
The complete xarray test suite and the Python 3.14 CI job have not yet been independently verified against this branch.
The availability checks are intended to reduce failures caused by external service outages. They do not guarantee that every possible network interruption will be detected.
Related PR
Related to #11713, which encountered six OPeNDAP-related CI failures. This is a separate infrastructure improvement and does not change the documentation contribution in that PR.
AI Disclosure
OpenAI ChatGPT assisted with preparing the implementation, test cases, and initial documentation for this contribution.
The contributor is responsible for independently reviewing, understanding, and validating the final changes.