summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-01-31 08:29:35 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-01-31 08:29:35 (GMT)
commit0278032110fe5fc769d2160baeb3576714a2acd5 (patch)
tree9e502a9ea4369fde3f0ee46e357aff3d220950b9 /Lib/asyncio
parenta849be9c64fbda40de2e2643b4cb8f37e1d06e5d (diff)
downloadcpython-0278032110fe5fc769d2160baeb3576714a2acd5.zip
cpython-0278032110fe5fc769d2160baeb3576714a2acd5.tar.gz
cpython-0278032110fe5fc769d2160baeb3576714a2acd5.tar.bz2
Issue #20452: add more info in case of test_asyncio failure to try to debug the
failure on buildbot "x86 Ubuntu Shared 3.x"
Diffstat (limited to 'Lib/asyncio')
-rw-r--r--Lib/asyncio/base_events.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py
index 58c3520..4b3eced 100644
--- a/Lib/asyncio/base_events.py
+++ b/Lib/asyncio/base_events.py
@@ -620,10 +620,18 @@ class BaseEventLoop(events.AbstractEventLoop):
timeout = min(timeout, deadline)
# TODO: Instrumentation only in debug mode?
- if logger.isEnabledFor(logging.INFO):
+ # FIXME: don't force log (issue #20452)
+ if True: #logger.isEnabledFor(logging.INFO):
t0 = self.time()
event_list = self._selector.select(timeout)
t1 = self.time()
+ # FIXME: remove these debug info (issue #20452)
+ dt = t1-t0
+ if dt < timeout and not event_list:
+ print("WARNING: selector.select(timeout=%.20f) took dt=%.20f sec (dt-timeout=%+.20f)"
+ % (timeout, dt, dt-timeout), file=sys.__stdout__)
+ print("WARNING: dt+%.20f > timeout? %s"
+ % (self._granularity, (dt + self._granularity) > timeout), file=sys.__stdout__)
if t1-t0 >= 1:
level = logging.INFO
else: