Skip to content

Disable/skip time-dependent tests (e.g. test_iers_b_out_of_range_handling) #20725

Open

Description

@nh2

Description

test_iers_b_out_of_range_handling is a "time bomb" test that starts failing after a certain amount of time:

def test_iers_b_out_of_range_handling():
# The following error/warning applies only to IERS_B, not to the default IERS_Auto
with iers.earth_orientation_table.set(iers.IERS_B.open()):
now = Time.now()
# Should be fine with bundled IERS-B
(now - 300 * u.day).ut1
# Default is to raise an error
match = r"\(some\) times are outside of range covered by IERS table"

That is not great for reproducible builds, especially for Linux distributions.

NixOS example:

In this case, the failing time-based test (test_iers_b_out_of_range_handling) is holding up the testing and release of the critical brotli security vulnerability CVE-2026-111497.

It would be nice if tests could be written such that they do not fail after a certain amount of time, so software stays reproducible.

Expected behavior

No response

How to Reproduce

  1. Get package from '...'
  2. Then run '...'
  3. An error occurs.
# Put your Python code snippet here.

Versions

import astropy
astropy.system_info()
# Paste the result here

Activity

  1. pllim commented on Oct 27, 2026

    @pllim
    Member

    Can't you just skip it in your distro? I think @olebole skip some tests for Debian.

  2. olebole commented on Oct 27, 2026

    @olebole
    Member

    Yes, this is true. We use this patch to disable tests that may fail in the future.

    This however affects all distributions, so it may be however a good idea to flag these tests upstream for a pytest filter.

  3. nh2 commented on Oct 27, 2026

    @nh2
    Author
    1. Can't you just skip it in your distro?

    Yes, that's what the PR I linked does.

    My main point though is to question whether it's actually a good idea to have time bomb tests at all. It seems to run fundamentally against the idea of reproducibility, which is a good thing for distributions and upstreams alike.

    E.g. for a given table, wouldn't it be more sensible to check that it does its job for the range it covers, instead of making a test that checks if it works today?

  4. pllim commented on Oct 27, 2026

    @pllim
    Member

    Hmm... I guess we could add some env var you can use for skipping. There is precedent here:

    CI = os.environ.get("CI", "false") == "true"
    IS_CRON = os.environ.get("IS_CRON", "false") == "true"

    Ideas welcome.

  5. pllim commented on Oct 27, 2026

    @pllim
    Member

    wouldn't it be more sensible to check that it does its job for the range it covers

    I'll defer to wisdom of @mhvk for this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions