Flaky pydap network tests due to `test.opendap.org` outages

オープン
#11,718 コメント 6 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
22/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
docker, python
領域
ci-cd, testing

調査の方向性

The network tests that depend on test.opendap.org are in the pydap test modules, including TestPyDAPDatatreeIO in test_datatree.py, which uses the three /opendap/dap4/ files. The open question is which of the five options to adopt, so read the thread before writing code. Using the unaligned_datatree_nc fixture and the code near line 499 as a reference, check whether CI can generate the datatree files locally. Done means a maintainer has chosen an approach and the flaky job no longer fails on server outages.

索引モデルが issue の本文から書いたものです。

説明

Automation CI needs discussion topic-testing
What is your issue?

The pydap network tests depend on the public test.opendap.org server. Whenever that server is unreachable or returns errors (e.g. HTTP 503), the flaky/network CI job fails for unrelated PRs.

Some options:

  1. Run our own OPeNDAP server in CI. OPeNDAP publishes the server behind test.opendap.org as a Docker image (opendap/hyrax). Most of the test data is already in the image, and the rest could be added in CI. The tests would then read the server URL from an environment variable that defaults to test.opendap.org. The downside is a large image (~1.4 GB) and some extra CI setup.
  2. Use pydap's built-in server. Start pydap[server] from a pytest fixture with local files. This is lightweight, but as far as I can tell it doesn't serve DAP4 data responses, so it would only cover part of the tests.
  3. Record and replay HTTP responses. Store the server responses in the repo (e.g. with vcrpy/pytest-recording) and replay them in the tests. This is fast and needs no network, but the recordings need refreshing and wouldn't catch server-side changes.
  4. Skip when the server is unavailable. Check reachability once in a fixture and skip the tests if the server is down. This is the simplest option, but the tests silently stop running during outages.
  5. Move the tests to a scheduled job. Run them nightly instead of on every PR, so outages don't block PRs. Breakages would only show up later, though.

I think 1. could be feasable. Some things to consider:

  • Maybe we should mirror the dockerhub image to ghcr.
  • Not sure how to handle hyrax updates (another CI to update those?)
  • Caching is probably not worth
  • Not covered yet: the datatree tests (TestPyDAPDatatreeIO in test_datatree.py) use three files under /opendap/dap4/ that the image doesn't include:
    • SimpleGroup.nc4.h5: in OPeNDAP's server repo at modules/hdf5_handler/data/ (30 KB). We could commit it or download it in CI.
    • unaligned_simple_datatree.nc.h5 and all_aligned_child_nodes.nc.h5: these look like custom uploads to the public server. test_datatree.py already builds equivalent files locally (the unaligned_datatree_nc fixture and the code at line 499). Since the tests only check structure, CI could generate them before starting the container.
主要言語
Python
スター
4.2k
フォーク
1.5k
平均マージ
2日 21時間
マージ済み PR(30日)
74

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

pydata/xarray のほかの issue

pydata/xarray の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。