Skip to content

Commit

Permalink
Fix flaky test_when_timeout_smaller_second (#5117)
Browse files Browse the repository at this point in the history
* Fix flaky test_when_timeout_smaller_second

* Use absolute tolerance
  • Loading branch information
derlih authored and asvetlov committed Oct 24, 2020
1 parent 2dfdde4 commit 77f17c7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES/5116.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix flaky test_when_timeout_smaller_second
4 changes: 2 additions & 2 deletions tests/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import platform
import sys
import tempfile
from math import modf
from math import isclose, modf
from unittest import mock

import pytest
Expand Down Expand Up @@ -337,7 +337,7 @@ def test_when_timeout_smaller_second(loop) -> None:
handle.close()

assert isinstance(when, float)
assert abs(when - timer) < 0.01
assert isclose(when - timer, 0, abs_tol=0.001)


def test_timeout_handle_cb_exc(loop) -> None:
Expand Down

0 comments on commit 77f17c7

Please sign in to comment.