Skip to content

Commit c0a4fc9

Browse files
committed
wip more verbose for debugging
1 parent 0304c8c commit c0a4fc9

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ test_script:
8484
# but for now it lets us avoid duplication with .travis.yml and tox.ini.
8585
# Running "py3x-full" would be nice but it's failing on installing
8686
# dependencies with no useful logs.
87-
- "tox -e %TOX_ENV% -- %TOX_ARGS%"
87+
- "tox -e %TOX_ENV% -- --verbose %TOX_ARGS%"
8888

8989
after_test:
9090
# If tests are successful, create binary packages for the project.

tornado/platform/asyncio.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,14 @@ def _run_select(
515515
# we can rely on so ensuring proper synchronization would be
516516
# tricky.
517517
try:
518-
rs, ws, _ = select.select(to_read, to_write, [])
518+
# On windows, selecting on a socket for write will not
519+
# return the socket when there is an error (but selecting
520+
# for reads works). Also select for errors when selecting
521+
# for writes, and merge the results.
522+
#
523+
# https://github.com/python/cpython/blob/0dd98c2d00a75efbec19c2ed942923981bc06683/Lib/selectors.py#L313-L318
524+
rs, ws, xs = select.select(to_read, to_write, to_write)
525+
ws = ws + xs
519526
except OSError as e:
520527
# After remove_reader or remove_writer is called, the file
521528
# descriptor may subsequently be closed on the event loop
@@ -528,7 +535,7 @@ def _run_select(
528535
# event loop and we'll get the updated set of file
529536
# descriptors on the next iteration. Otherwise, raise the
530537
# original error.
531-
if e.errno == getattr(errno, "WSAENOTOTSOCK", errno.EBADF):
538+
if e.errno == getattr(errno, "WSAENOTSOCK", errno.EBADF):
532539
rs, _, _ = select.select([self._waker_r.fileno()], [], [], 0)
533540
if rs:
534541
return rs, []

tornado/test/ioloop_test.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,9 +400,14 @@ def handle_read(fd, events):
400400
client.close()
401401
server.close()
402402

403+
@skipIfNonUnix
403404
@gen_test
404405
def test_init_close_race(self):
405406
# Regression test for #2367
407+
#
408+
# Skipped on windows because of what looks like a bug in the
409+
# proactor event loop when started and stopped on non-main
410+
# threads.
406411
def f():
407412
for i in range(10):
408413
loop = IOLoop()

tornado/test/iostream_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ async def test_read_until_with_close_after_second_packet(self):
301301
async with self.iostream_pair() as (rs, ws):
302302
rf = asyncio.ensure_future(rs.read_until(b"done"))
303303
await ws.write(b"x" * 2048)
304+
await asyncio.sleep(0.1)
304305
ws.write(b"done")
305306
ws.close()
306307
await rf

0 commit comments

Comments
 (0)