python fails asyncio tests (py 3.7 & 3.8)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

python fails asyncio tests (py 3.7 & 3.8)

Jim Bell
The standard python asyncio tests hang.

         cd /usr/lib/python3.8/test

         python3.8 test_asyncore.py -v

Passes a bunch of tests, then hangs at:

     test_connection_attributes (__main__.TestAPI_UseUnixSocketsPoll) ...

(A more focused test run: "python3.8 test_asyncore.py -c -f -k Unix")

Likewise,

         python3.8 -m unittest -v test_asyncio

Passes a bunch of tests, then hangs at:

     test_create_unix_server
(test.test_asyncio.test_events.PollEventLoopTests) ...

I tried enabling tracing, but then unittest doesn't want to run any
tests ("python3.8 -m trace -c test_asyncore.py" says "Ran 0 tests")

Same for python3.7. I only tested 3.7 & 3.8.

Glad to attach a run of "cygcheck -s -v -r" but it's 1.4M. Running
CygWin-64 under Windows 10 Professional Ver 10.0 Build 19041



--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple
Reply | Threaded
Open this post in threaded view
|

Re: python fails asyncio tests (py 3.7 & 3.8)

Jim Bell
On 2020-11-21 5:59 AM, Jim Bell wrote:
> The standard python asyncio tests hang.
>
>         cd /usr/lib/python3.8/test
>
>         python3.8 test_asyncore.py -v
>
> [...]


Using strace, stripping down this very repeatable test, and grabbing the
source-code snapshot, it looks like winsup/cygwin/select.cc
socket_cleanup() is waiting forever for the thread to go away.

strace:

   121 6732185 [main] python3.8 13329 select_stuff::cleanup: calling
cleanup rout
ines
   178 6732363 [main] python3.8 13329 socket_cleanup: si 0x800290E10
si->thread 0
x18023E758
-

But I don't see the select_printf("returning")  at select.cc:1808, so
the si->thread->detach() call seems to be blocked forever.  I don't see
that we make it here either:

     select.cc:1685  select_printf ("leaving thread_socket");

I see a bool stop_thread field in select_info, inherited by
select_socket_info (select.h), used by other mechanisms. Seems that
could be set by socket_cleanup() and used by thread_socket() to break
out of its event loops (select.cc lines 1660  and 1667)

https://cygwin.com/git/?p=newlib-cygwin.git;a=blob;f=winsup/cygwin/select.cc;hb=HEAD#l1796


--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple