ecmwf / earthkit-data

A format-agnostic Python interface for geospatial data
Apache License 2.0
47 stars 9 forks source link

Add timeout to cds tests #320

Closed sandorkertesz closed 4 months ago

sandorkertesz commented 4 months ago

Some cds retrieval tests tend to hang so a timeout was added to all the tests in tests/sources/test_cds.py. The default value is 30 seconds and it can be controlled via the --cds-timeout custom option to pytest. Please note that some tests have a custom hardcoded timeout value that cannot be changed via this option.

Usage (e.g. to set the timeout to 60 seconds):

pytest -E long --cds-timeout=60 -v -k test_cds

The options documentation (from pytest --help):


Custom options:
  -E NAME               NAME: short, long, release, documentation. Runs a subset of tests.
                        'short': skip tests marked as download,ftp,long_test.
                        'long': skip tests marked as ftp.
                        'release': do not skip tests.
                        'documentation': do not skip tests.
  --cds-timeout=TIMEOUT
                        Timeout in seconds for cds tests. 0 means no timeout. Default is 30.