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

test_when_timeout_smaller_second is flaky #5116

Closed
derlih opened this issue Oct 24, 2020 · 1 comment
Closed

test_when_timeout_smaller_second is flaky #5116

derlih opened this issue Oct 24, 2020 · 1 comment
Labels

Comments

@derlih
Copy link
Contributor

derlih commented Oct 24, 2020

🐞 Describe the bug
Sometimes test_when_timeout_smaller_second fails

💡 To Reproduce
Run this test multiple times

pip install pytest-repeat
pytest -q tests/test_helpers.py::test_when_timeout_smaller_second --count 1000 -x

💡 Expected behavior
Test shouldn't fail

📋 Logs/tracebacks

loop = <_UnixSelectorEventLoop running=False closed=False debug=False>

    def test_when_timeout_smaller_second(loop) -> None:
        timeout = 0.1
        timer = loop.time() + timeout
    
        handle = helpers.TimeoutHandle(loop, timeout)
        when = handle.start()._when
        handle.close()
    
        assert isinstance(when, float)
>       assert f"{when:.3f}" == f"{timer:.3f}"
E       AssertionError: assert '151331.472' == '151331.471'
E         - 151331.471
E         ?          ^
E         + 151331.472
E         ?          ^

📋 Your version of the Python

$ python --version
Python 3.8.5

📋 Your version of the aiohttp/yarl/multidict distributions

$ python -m pip show aiohttp
4.0.0a1
$ python -m pip show multidict
5.0.0
$ python -m pip show yarl
1.6.1
@asvetlov
Copy link
Member

Fixed by #5117

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants