Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(tests): Increase time bias limit to 0.02 #529

Closed
wants to merge 1 commit into from

Conversation

Xeonacid
Copy link

On my RISC-V board, it would be a little more than 0.01, such as 0.012354135513305664.

=================================== FAILURES ===================================
___________________________ test_function_times_out ____________________________

    def test_function_times_out() -> None:
        """Test time outs with retry_until()."""
        ini = time()
    
        def never_true() -> bool:
            return False
    
        with pytest.raises(WaitTimeout):
            retry_until(never_true, 1)
    
        end = time()
    
>       assert abs((end - ini) - 1.0) < 0.01
E       assert 0.01162266731262207 < 0.01
E        +  where 0.01162266731262207 = abs(((1708230824.4211185 - 1708230823.4094958) - 1.0))

tests/test_test.py:44: AssertionError
___________________ test_function_times_out_no_raise_assert ____________________

    def test_function_times_out_no_raise_assert() -> None:
        """Tests retry_until() with exception raising disabled, returning False."""
        ini = time()
    
        def never_true() -> bool:
            return False
    
        assert not retry_until(never_true, 1, raises=False)
    
        end = time()
    
>       assert abs((end - ini) - 1.0) < 0.01
E       assert 0.011825084686279297 < 0.01
E        +  where 0.011825084686279297 = abs(((1708230826.5377028 - 1708230825.5258777) - 1.0))

tests/test_test.py:72: AssertionError
_______________________ test_function_times_out_no_raise _______________________

    def test_function_times_out_no_raise() -> None:
        """Tests retry_until() with exception raising disabled."""
        ini = time()
    
        def never_true() -> bool:
            return False
    
        retry_until(never_true, 1, raises=False)
    
        end = time()
    
>       assert abs((end - ini) - 1.0) < 0.01
E       assert 0.012354135513305664 < 0.01
E        +  where 0.012354135513305664 = abs(((1708230865.1922984 - 1708230864.1799443) - 1.0))

tests/legacy_api/test_test.py:58: AssertionError
___________________ test_function_times_out_no_raise_assert ____________________

    def test_function_times_out_no_raise_assert() -> None:
        """Tests retry_until() with exception raising disabled, returning False."""
        ini = time()
    
        def never_true() -> bool:
            return False
    
        assert not retry_until(never_true, 1, raises=False)
    
        end = time()
    
>       assert abs((end - ini) - 1.0) < 0.01
E       assert 0.010137319564819336 < 0.01
E        +  where 0.010137319564819336 = abs(((1708230866.2246602 - 1708230865.2145228) - 1.0))

tests/legacy_api/test_test.py:72: AssertionError
=========================== short test summary info ============================
FAILED tests/test_test.py::test_function_times_out - assert 0.011622667312622...
FAILED tests/test_test.py::test_function_times_out_no_raise_assert - assert 0...
FAILED tests/legacy_api/test_test.py::test_function_times_out_no_raise - asse...
FAILED tests/legacy_api/test_test.py::test_function_times_out_no_raise_assert

On my RISC-V board, it would be a little more than 0.01, such as 0.012354135513305664.

Signed-off-by: Xeonacid <xeonacid@hit.edu.cn>
Copy link

codecov bot commented Feb 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (48ea20b) 88.76% compared to head (5432630) 88.38%.
Report is 74 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #529      +/-   ##
==========================================
- Coverage   88.76%   88.38%   -0.38%     
==========================================
  Files          37       37              
  Lines        3685     3797     +112     
  Branches      526      549      +23     
==========================================
+ Hits         3271     3356      +85     
- Misses        281      304      +23     
- Partials      133      137       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tony
Copy link
Member

tony commented Feb 18, 2024

While I don't see a CLA message showing you signed it, I see you on https://cla-assistant.io/

image

@tony tony self-requested a review February 18, 2024 11:14
@tony
Copy link
Member

tony commented Feb 18, 2024

Potentially fixes #481, cc @johanneskastl

@tony
Copy link
Member

tony commented Feb 18, 2024

Also related to #477 and #478 (comment).

@tony
Copy link
Member

tony commented Feb 18, 2024

@Xeonacid FYI: After merge, I may extract the 0.02 into a constant that can be higher.

@Xeonacid
Copy link
Author

@Xeonacid FYI: After merge, I may extract the 0.02 into a constant that can be higher.

Glad to see that! Or you may tell me how much you want so I can just fix in this PR.

@tony
Copy link
Member

tony commented Feb 18, 2024

No.

I take that back, I don't want this.

@tony tony closed this Feb 18, 2024
@Xeonacid
Copy link
Author

No.

I take that back, I don't want this.

Could you please explain why? As the issues you mentioned, it seems flaky and reproduces on many architectures.

Xeonacid added a commit to Xeonacid/archriscv-packages that referenced this pull request Feb 18, 2024
Upstream actively rejected the patch: tmux-python/libtmux#529 (comment)

Signed-off-by: Xeonacid <h.dwwwwww@gmail.com>
felixonmars pushed a commit to felixonmars/archriscv-packages that referenced this pull request Feb 18, 2024
Upstream actively rejected the patch: tmux-python/libtmux#529 (comment)

Signed-off-by: Xeonacid <h.dwwwwww@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants