Skip to content

[4.1RC2] test_timer failed on s390x #10847

Closed

Description

@olebole

Description

After uploading a (mainly unchanged) release to Debian, our s390x build failed with the following test failure:

__________________________________ test_timer __________________________________

    @pytest.mark.filterwarnings("ignore")
    def test_timer():
        """Test function timer."""
        from astropy.utils.timer import RunTimePredictor
        p = RunTimePredictor(func_to_time)
    
        # --- These must run before data points are introduced. ---
    
        with pytest.raises(ValueError):
            p.do_fit()
    
        with pytest.raises(RuntimeError):
            p.predict_time(100)
    
        # --- These must run next to set up data points. ---
    
        p.time_func([2.02, 2.04, 2.1, 'a', 2.3])
        p.time_func(2.2)  # Test OrderedDict
    
        assert p._funcname == 'func_to_time'
        assert p._cache_bad == ['a']
    
        k = list(p.results.keys())
        v = list(p.results.values())
        np.testing.assert_array_equal(k, [2.02, 2.04, 2.1, 2.3, 2.2])
        np.testing.assert_allclose(v, [0.1, 0.2, 0.5, 1.5, 1.0])
    
        # --- These should only run once baseline is established. ---
    
        with pytest.raises(ModelsError):
            a = p.do_fit(model='foo')
    
        with pytest.raises(ModelsError):
            a = p.do_fit(fitter='foo')
    
        a = p.do_fit()
    
        assert p._power == 1
    
        # Perfect slope is 5, with 10% uncertainty
>       assert 4.5 <= a[1] <= 5.5
E       assert 4.5 <= 3.2149869047170583

astropy/utils/tests/test_timer.py:75: AssertionError

Since the changes are far away from the test (#10765, skipping test_wcsapi_extension) I would guess this is due to some unreliable timings on the build machine, therefore not really problematic. I will just disable this one for the 4.2 build.

Expected behavior

The test is expected to succeed

Actual behavior

Test fails.

Steps to Reproduce

Probably this failure is rare and not simply to reproduce.

Activity

  1. pllim commented on Oct 13, 2020

    @pllim
    Member

    Don't worry about it. I moved timer to astroquery anyway. Just sitting out the deprecation period before removing it altogether. You can safely ignore this failure. See #9050 and #10281

  2. olebole commented on Oct 13, 2020

    @olebole
    MemberAuthor

    I personally would keep it open and close it with the final removal of timer (and so have it ready when someone falls into the same problem), but this is a matter of taste -- it is probably easy to forget forever if it is kept open now.

  3. mhvk commented on Oct 13, 2020

    @mhvk
    Contributor

    @pllim - is there a particular release when timer is removed? Perhaps we can just milestone this one with that release. Beyond the benefit mentioned by @olebole of allowing this to be found, a bonus one will be that it will remind us to do the actual deprecation...

  4. pllim commented on Oct 13, 2020

    @pllim
    Member

    Removal has a PR at #10281 but I don't think we reached a consensus on the milestone.

  5. removed
    Close?Tell stale bot that this issue/PR is stale
    on Oct 13, 2020
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