question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

test_timer failure in v4.0.x

See original GitHub issue

I noticed the following failure in the v4.0.x CI (https://github.com/astropy/astropy/pull/11398/checks?check_run_id=2147521346)

    @pytest.mark.filterwarnings("ignore")
1081
    def test_timer():
1082
        """Test function timer."""
1083
        from astropy.utils.timer import RunTimePredictor
1084
        p = RunTimePredictor(func_to_time)
1085
    
1086
        # --- These must run before data points are introduced. ---
1087
    
1088
        with pytest.raises(ValueError):
1089
            p.do_fit()
1090
    
1091
        with pytest.raises(RuntimeError):
1092
            p.predict_time(100)
1093
    
1094
        # --- These must run next to set up data points. ---
1095
    
1096
        p.time_func([2.02, 2.04, 2.1, 'a', 2.3])
1097
        p.time_func(2.2)  # Test OrderedDict
1098
    
1099
        assert p._funcname == 'func_to_time'
1100
        assert p._cache_bad == ['a']
1101
    
1102
        k = list(p.results.keys())
1103
        v = list(p.results.values())
1104
        np.testing.assert_array_equal(k, [2.02, 2.04, 2.1, 2.3, 2.2])
1105
        np.testing.assert_allclose(v, [0.1, 0.2, 0.5, 1.5, 1.0])
1106
    
1107
        # --- These should only run once baseline is established. ---
1108
    
1109
        with pytest.raises(ModelsError):
1110
            a = p.do_fit(model='foo')
1111
    
1112
        with pytest.raises(ModelsError):
1113
            a = p.do_fit(fitter='foo')
1114
    
1115
        a = p.do_fit()
1116
    
1117
        assert p._power == 1
1118
    
1119
        # Perfect slope is 5, with 10% uncertainty
1120
        assert 4.5 <= a[1] <= 5.5
1121
    
1122
        # Perfect intercept is -10, with 1-sec uncertainty
1123
>       assert -11 <= a[0] <= -9
1124
E       assert -8.99263929034811 <= -9
1125

This might be a non-deterministic numerical accuracy failure? It’s curious that the value is so close to -9 when it should be -10?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
github-actions[bot]commented, May 20, 2021

This issue was labeled as Close?. Remove Close? label or this will be closed after 7 days. (This is currently a dry-run.)

0reactions
pllimcommented, Jun 21, 2021

Re: bot – Actions is only in dry run mode because upstream needs more fixes. astropy-bot is, uh, on vacation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

System Timer Unit Testing Description - QuickTech Self Boot ...
Systems that speed up the timer to gain better performance may fail Timer Channel 1. This failure is a compatibility failure and can...
Read more >
4 Beeps on Post, intermittent problem | TechPowerUp Forums
You could try reseating RAM or using only one stick, but System Timer Failure usually means the board is dead (or dying).
Read more >
How to unit test a function is called correctly after a timer has ...
When the test runs, I get a failed result saying "expected 'undefined' to be 'defined'. " If I continue to watch the console,...
Read more >
If your computer beeps and fails to boot - IU KB
If your computer beeps and fails to boot. On startup, computers perform a Power-on Self Test, commonly referred to as a POST.
Read more >
Computer POST and beep codes
The computer POST (power-on self-test) checks a computer's internal hardware for ... Below are the beep codes for Phoenix BIOS Q3.07 or 4.x....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found