diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-03-25 11:50:50 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-03-25 11:50:50 (GMT) |
commit | b60ac7acfbc2a98425982cdbbb693aa6a3c9eb7a (patch) | |
tree | 146a162ba321c20e561f5180dfd950f9e06a9d1e /Lib | |
parent | 6f20b7c4736897cc3bc211d68abdd7d87cce2e44 (diff) | |
download | cpython-b60ac7acfbc2a98425982cdbbb693aa6a3c9eb7a.zip cpython-b60ac7acfbc2a98425982cdbbb693aa6a3c9eb7a.tar.gz cpython-b60ac7acfbc2a98425982cdbbb693aa6a3c9eb7a.tar.bz2 |
Issue #21038: Use monotonic clock to compute timeout, not the system clock
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_epoll.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Lib/test/test_epoll.py b/Lib/test/test_epoll.py index d8af841..b37f033 100644 --- a/Lib/test/test_epoll.py +++ b/Lib/test/test_epoll.py @@ -163,9 +163,9 @@ class TestEPoll(unittest.TestCase): ep.register(client.fileno(), select.EPOLLIN | select.EPOLLOUT | select.EPOLLET) - now = time.time() + now = time.monotonic() events = ep.poll(1, 4) - then = time.time() + then = time.monotonic() self.assertFalse(then - now > 0.1, then - now) events.sort() @@ -181,9 +181,9 @@ class TestEPoll(unittest.TestCase): client.send(b"Hello!") server.send(b"world!!!") - now = time.time() + now = time.monotonic() events = ep.poll(1, 4) - then = time.time() + then = time.monotonic() self.assertFalse(then - now > 0.01) events.sort() @@ -195,9 +195,9 @@ class TestEPoll(unittest.TestCase): ep.unregister(client.fileno()) ep.modify(server.fileno(), select.EPOLLOUT) - now = time.time() + now = time.monotonic() events = ep.poll(1, 4) - then = time.time() + then = time.monotonic() self.assertFalse(then - now > 0.01) expected = [(server.fileno(), select.EPOLLOUT)] @@ -214,9 +214,9 @@ class TestEPoll(unittest.TestCase): ep = select.epoll(16) ep.register(server) - now = time.time() + now = time.monotonic() events = ep.poll(1, 4) - then = time.time() + then = time.monotonic() self.assertFalse(then - now > 0.01) server.close() |