Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-79940: add introspection API for asynchronous generators #11590

Merged
merged 6 commits into from
Mar 11, 2023

Conversation

tkren
Copy link
Contributor

@tkren tkren commented Jan 17, 2019

The inspect module does not contain functions for determining the current state of asynchronous generators. That is, there is no introspection API for asynchronous generators that match the API for generators and coroutines: https://docs.python.org/3.8/library/inspect.html#current-state-of-generators-and-coroutines.

The functions inspect.getasyncgenstate and inspect.getasyncgenlocals allow to determine the current state of asynchronous generators and mirror the introspection API for generators and coroutines.

https://bugs.python.org/issue35759

https://bugs.python.org/issue35759

@tkren
Copy link
Contributor Author

tkren commented Jan 26, 2021

@1st1 This PR is open for some time now, is it still considered?

Also, it appears that the CI/CD pipeline got stuck, the Ubuntu & Windows status is in limbo

@tkren
Copy link
Contributor Author

tkren commented Oct 9, 2021

Rebased this branch onto main and adapted docs and unit tests for Python 3.11

@tkren tkren changed the title bpo-35759: add introspection API for asynchronous generators gh-79940: add introspection API for asynchronous generators Feb 26, 2023
@tkren tkren requested a review from markshannon as a code owner February 26, 2023 22:24
The functions inspect.getasyncgenstate and inspect.getasyncgenlocals
allow to determine the current state of asynchronous generators and
mirror the introspection API for generators and coroutines.
@tkren
Copy link
Contributor Author

tkren commented Feb 26, 2023

Rebased this branch onto main and adapted docs and unit tests for Python 3.12

Following additional changes:

Lib/inspect.py Outdated Show resolved Hide resolved
@tkren tkren requested review from kumaraditya303 and removed request for 1st1 and markshannon March 10, 2023 17:02
@kumaraditya303 kumaraditya303 self-assigned this Mar 11, 2023
@kumaraditya303 kumaraditya303 added type-feature A feature request or enhancement 3.12 bugs and security fixes labels Mar 11, 2023
@tkren
Copy link
Contributor Author

tkren commented Mar 11, 2023

Adapting whatsnew entry, Docs run fails with

Error: /home/runner/work/cpython/cpython/Doc/whatsnew/3.12.rst:247: ERROR: The GitHub ID '11590' seems too low -- use :issue:`...` for BPO IDs

@tkren tkren requested a review from kumaraditya303 March 11, 2023 13:16
Copy link
Contributor

@kumaraditya303 kumaraditya303 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for working on this!

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot wasm32-emscripten node (dynamic linking) 3.x has failed when building commit ced13c9.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/1056/builds/1507) and take a look at the build logs.
  4. Check if the failure is related to this commit (ced13c9) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/1056/builds/1507

Failed tests:

  • test_inspect

Summary of the results of the build (if available):

== Tests result: FAILURE ==

334 tests OK.

10 slowest tests:

  • test_compile: 9 min 53 sec
  • test_math: 1 min 59 sec
  • test_tokenize: 59.0 sec
  • test_hashlib: 40.3 sec
  • test_unparse: 37.0 sec
  • test_lib2to3: 34.0 sec
  • test_capi: 29.9 sec
  • test_argparse: 27.9 sec
  • test_unicodedata: 25.0 sec
  • test_pickle: 20.7 sec

1 test failed:
test_inspect

99 tests skipped:
test__xxinterpchannels test__xxsubinterpreters test_asyncgen
test_asyncio test_check_c_globals test_clinic test_cmd_line
test_concurrent_futures test_contextlib_async test_ctypes
test_curses test_dbm_gnu test_dbm_ndbm test_devpoll test_doctest
test_docxmlrpc test_dtrace test_embed test_epoll test_faulthandler
test_fcntl test_file_eintr test_fork1 test_ftplib test_gdb
test_grp test_httplib test_httpservers test_idle test_imaplib
test_interpreters test_ioctl test_kqueue test_launcher test_lzma
test_mmap test_msilib test_multiprocessing_fork
test_multiprocessing_forkserver test_multiprocessing_main_handling
test_multiprocessing_spawn test_nis test_openpty test_ossaudiodev
test_pdb test_peg_generator test_perf_profiler test_poll
test_poplib test_pty test_pwd test_queue test_readline
test_regrtest test_repl test_resource test_select test_selectors
test_smtplib test_smtpnet test_socket test_socketserver test_spwd
test_ssl test_stable_abi_ctypes test_startfile test_subprocess
test_sys_settrace test_syslog test_tcl test_telnetlib test_thread
test_threadedtempfile test_threading test_threading_local test_tix
test_tkinter test_tools test_ttk test_ttk_textonly test_turtle
test_urllib2 test_urllib2_localnet test_urllib2net test_urllibnet
test_venv test_wait3 test_wait4 test_webbrowser test_winconsoleio
test_winreg test_winsound test_wmi test_wsgiref test_xmlrpc
test_xmlrpc_net test_zipfile64 test_zipimport_support
test_zoneinfo
0:26:38 load avg: 6.74
0:26:38 load avg: 6.74 Re-running failed tests is not supported with --python host runner option.

Total duration: 26 min 38 sec

Click to see traceback logs
remote: Enumerating objects: 18, done.        
remote: Counting objects:   5% (1/17)        
remote: Counting objects:  11% (2/17)        
remote: Counting objects:  17% (3/17)        
remote: Counting objects:  23% (4/17)        
remote: Counting objects:  29% (5/17)        
remote: Counting objects:  35% (6/17)        
remote: Counting objects:  41% (7/17)        
remote: Counting objects:  47% (8/17)        
remote: Counting objects:  52% (9/17)        
remote: Counting objects:  58% (10/17)        
remote: Counting objects:  64% (11/17)        
remote: Counting objects:  70% (12/17)        
remote: Counting objects:  76% (13/17)        
remote: Counting objects:  82% (14/17)        
remote: Counting objects:  88% (15/17)        
remote: Counting objects:  94% (16/17)        
remote: Counting objects: 100% (17/17)        
remote: Counting objects: 100% (17/17), done.        
remote: Compressing objects:   7% (1/14)        
remote: Compressing objects:  14% (2/14)        
remote: Compressing objects:  21% (3/14)        
remote: Compressing objects:  28% (4/14)        
remote: Compressing objects:  35% (5/14)        
remote: Compressing objects:  42% (6/14)        
remote: Compressing objects:  50% (7/14)        
remote: Compressing objects:  57% (8/14)        
remote: Compressing objects:  64% (9/14)        
remote: Compressing objects:  71% (10/14)        
remote: Compressing objects:  78% (11/14)        
remote: Compressing objects:  85% (12/14)        
remote: Compressing objects:  92% (13/14)        
remote: Compressing objects: 100% (14/14)        
remote: Compressing objects: 100% (14/14), done.        
remote: Total 18 (delta 3), reused 5 (delta 3), pack-reused 1        
From https://github.com/python/cpython
 * branch                  main       -> FETCH_HEAD
Note: switching to 'ced13c96a4eb9391a9d27e3e13218f70c579670f'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at ced13c96a4 gh-79940: add introspection API for asynchronous generators to `inspect` module (#11590)
Switched to and reset branch 'main'

../../Objects/obmalloc.c:775:1: warning: always_inline function might not be inlinable [-Wattributes]
  775 | arena_map_get(pymem_block *p, int create)
      | ^~~~~~~~~~~~~

configure: ../../configure --prefix $(PWD)/target/host --with-pydebug --without-pydebug --with-emscripten-target=node --enable-wasm-dynamic-linking --disable-wasm-pthreads --build=x86_64-pc-linux-gnu --host=wasm32-unknown-emscripten --with-build-python=../build/python
configure: WARNING: using cross tools not prefixed with host triplet
mcc: error: no input files

make: make -j2 all
../../Python/initconfig.c:2360:27: warning: format specifies type 'wint_t' (aka 'int') but the argument has type 'wint_t' (aka 'unsigned int') [-Wformat]
    printf(usage_envvars, (wint_t)DELIM, (wint_t)DELIM, PYTHONHOMEHELP);
           ~~~~~~~~~~~~~  ^~~~~~~~~~~~~
../../Python/initconfig.c:145:18: note: format string is defined here
"PYTHONPATH   : '%lc'-separated list of directories prefixed to the\n"
                 ^~~
                 %c
../../Python/initconfig.c:2360:42: warning: format specifies type 'wint_t' (aka 'int') but the argument has type 'wint_t' (aka 'unsigned int') [-Wformat]
    printf(usage_envvars, (wint_t)DELIM, (wint_t)DELIM, PYTHONHOMEHELP);
           ~~~~~~~~~~~~~                 ^~~~~~~~~~~~~
../../Python/initconfig.c:148:58: note: format string is defined here
"PYTHONHOME   : alternate <prefix> directory (or <prefix>%lc<exec_prefix>).\n"
                                                         ^~~
                                                         %c
2 warnings generated.
../../Modules/expat/xmlparse.c:3116:9: warning: code will never be executed [-Wunreachable-code]
        parser->m_characterDataHandler(parser->m_handlerArg, parser->m_dataBuf,
        ^~~~~~
../../Modules/expat/xmlparse.c:3115:16: note: silence by adding parentheses to mark code as explicitly dead
      else if (0 && parser->m_characterDataHandler)
               ^
               /* DISABLES CODE */ ( )
../../Modules/expat/xmlparse.c:4059:9: warning: code will never be executed [-Wunreachable-code]
        parser->m_characterDataHandler(parser->m_handlerArg, parser->m_dataBuf,
        ^~~~~~
../../Modules/expat/xmlparse.c:4058:16: note: silence by adding parentheses to mark code as explicitly dead
      else if (0 && parser->m_characterDataHandler)
               ^
               /* DISABLES CODE */ ( )
../../Modules/expat/xmlparse.c:7703:11: warning: format specifies type 'int' but the argument has type 'ptrdiff_t' (aka 'long') [-Wformat]
          bytesMore, (account == XML_ACCOUNT_DIRECT) ? "DIR" : "EXP",
          ^~~~~~~~~
3 warnings generated.
../../Modules/socketmodule.c:4047:33: warning: comparison of integers of different signs: 'unsigned long' and 'long' [-Wsign-compare]
         cmsgh != NULL; cmsgh = CMSG_NXTHDR(&msg, cmsgh)) {
                                ^~~~~~~~~~~~~~~~~~~~~~~~
/opt/buildbot/.emscripten_cache/sysroot/include/sys/socket.h:356:44: note: expanded from macro 'CMSG_NXTHDR'
        __CMSG_LEN(cmsg) + sizeof(struct cmsghdr) >= __MHDR_END(mhdr) - (unsigned char *)(cmsg) \
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../Modules/socketmodule.c:4100:33: warning: comparison of integers of different signs: 'unsigned long' and 'long' [-Wsign-compare]
         cmsgh != NULL; cmsgh = CMSG_NXTHDR(&msg, cmsgh)) {
                                ^~~~~~~~~~~~~~~~~~~~~~~~
/opt/buildbot/.emscripten_cache/sysroot/include/sys/socket.h:356:44: note: expanded from macro 'CMSG_NXTHDR'
        __CMSG_LEN(cmsg) + sizeof(struct cmsghdr) >= __MHDR_END(mhdr) - (unsigned char *)(cmsg) \
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../Modules/socketmodule.c:4724:54: warning: comparison of integers of different signs: 'unsigned long' and 'long' [-Wsign-compare]
            cmsgh = (i == 0) ? CMSG_FIRSTHDR(&msg) : CMSG_NXTHDR(&msg, cmsgh);
                                                     ^~~~~~~~~~~~~~~~~~~~~~~~
/opt/buildbot/.emscripten_cache/sysroot/include/sys/socket.h:356:44: note: expanded from macro 'CMSG_NXTHDR'
        __CMSG_LEN(cmsg) + sizeof(struct cmsghdr) >= __MHDR_END(mhdr) - (unsigned char *)(cmsg) \
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 warnings generated.
../../Modules/_sqlite/connection.c:2197:19: warning: result of comparison of constant 9223372036854775807 with expression of type 'Py_ssize_t' (aka 'long') is always false [-Wtautological-constant-out-of-range-compare]
    if (data->len > 9223372036854775807) {  // (1 << 63) - 1
        ~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~
1 warning generated.

make: *** [Makefile:1913: buildbottest] Error 2

Cannot open file '/opt/buildbot/bcannon-wasm/3.x.bcannon-wasm.emscripten-node-dl/build/build/build_oot/host/test-results.xml' for upload

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot wasm32-emscripten node (pthreads) 3.x has failed when building commit ced13c9.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/1050/builds/1504) and take a look at the build logs.
  4. Check if the failure is related to this commit (ced13c9) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/1050/builds/1504

Failed tests:

  • test_inspect

Summary of the results of the build (if available):

== Tests result: FAILURE ==

338 tests OK.

10 slowest tests:

  • test_compile: 10 min 14 sec
  • test_math: 1 min 39 sec
  • test_tokenize: 1 min 3 sec
  • test_unparse: 40.8 sec
  • test_lib2to3: 40.3 sec
  • test_io: 37.7 sec
  • test_capi: 30.5 sec
  • test_hashlib: 26.6 sec
  • test_unicodedata: 25.2 sec
  • test_pickle: 21.3 sec

1 test failed:
test_inspect

95 tests skipped:
test__xxinterpchannels test__xxsubinterpreters test_asyncgen
test_asyncio test_check_c_globals test_clinic test_cmd_line
test_concurrent_futures test_contextlib_async test_ctypes
test_curses test_dbm_gnu test_dbm_ndbm test_devpoll test_doctest
test_docxmlrpc test_dtrace test_embed test_epoll test_faulthandler
test_fcntl test_file_eintr test_fork1 test_ftplib test_gdb
test_grp test_httplib test_httpservers test_idle test_imaplib
test_interpreters test_ioctl test_kqueue test_launcher test_lzma
test_mmap test_msilib test_multiprocessing_fork
test_multiprocessing_forkserver test_multiprocessing_main_handling
test_multiprocessing_spawn test_nis test_openpty test_ossaudiodev
test_pdb test_peg_generator test_perf_profiler test_poll
test_poplib test_pty test_pwd test_readline test_regrtest
test_repl test_resource test_select test_selectors test_smtplib
test_smtpnet test_socket test_socketserver test_spwd test_ssl
test_stable_abi_ctypes test_startfile test_subprocess
test_sys_settrace test_syslog test_tcl test_telnetlib test_tix
test_tkinter test_tools test_ttk test_ttk_textonly test_turtle
test_urllib2 test_urllib2_localnet test_urllib2net test_urllibnet
test_venv test_wait3 test_wait4 test_webbrowser test_winconsoleio
test_winreg test_winsound test_wmi test_wsgiref test_xmlrpc
test_xmlrpc_net test_xxlimited test_zipfile64
test_zipimport_support test_zoneinfo
0:25:52 load avg: 6.90
0:25:52 load avg: 6.90 Re-running failed tests is not supported with --python host runner option.

Total duration: 25 min 52 sec

Click to see traceback logs
remote: Enumerating objects: 18, done.        
remote: Counting objects:   5% (1/17)        
remote: Counting objects:  11% (2/17)        
remote: Counting objects:  17% (3/17)        
remote: Counting objects:  23% (4/17)        
remote: Counting objects:  29% (5/17)        
remote: Counting objects:  35% (6/17)        
remote: Counting objects:  41% (7/17)        
remote: Counting objects:  47% (8/17)        
remote: Counting objects:  52% (9/17)        
remote: Counting objects:  58% (10/17)        
remote: Counting objects:  64% (11/17)        
remote: Counting objects:  70% (12/17)        
remote: Counting objects:  76% (13/17)        
remote: Counting objects:  82% (14/17)        
remote: Counting objects:  88% (15/17)        
remote: Counting objects:  94% (16/17)        
remote: Counting objects: 100% (17/17)        
remote: Counting objects: 100% (17/17), done.        
remote: Compressing objects:   6% (1/15)        
remote: Compressing objects:  13% (2/15)        
remote: Compressing objects:  20% (3/15)        
remote: Compressing objects:  26% (4/15)        
remote: Compressing objects:  33% (5/15)        
remote: Compressing objects:  40% (6/15)        
remote: Compressing objects:  46% (7/15)        
remote: Compressing objects:  53% (8/15)        
remote: Compressing objects:  60% (9/15)        
remote: Compressing objects:  66% (10/15)        
remote: Compressing objects:  73% (11/15)        
remote: Compressing objects:  80% (12/15)        
remote: Compressing objects:  86% (13/15)        
remote: Compressing objects:  93% (14/15)        
remote: Compressing objects: 100% (15/15)        
remote: Compressing objects: 100% (15/15), done.        
remote: Total 18 (delta 2), reused 3 (delta 2), pack-reused 1        
From https://github.com/python/cpython
 * branch                  main       -> FETCH_HEAD
Note: switching to 'ced13c96a4eb9391a9d27e3e13218f70c579670f'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at ced13c96a4 gh-79940: add introspection API for asynchronous generators to `inspect` module (#11590)
Switched to and reset branch 'main'

../../Objects/obmalloc.c:775:1: warning: always_inline function might not be inlinable [-Wattributes]
  775 | arena_map_get(pymem_block *p, int create)
      | ^~~~~~~~~~~~~

configure: ../../configure --prefix $(PWD)/target/host --with-pydebug --without-pydebug --with-emscripten-target=node --disable-wasm-dynamic-linking --enable-wasm-pthreads --build=x86_64-pc-linux-gnu --host=wasm32-unknown-emscripten --with-build-python=../build/python
configure: WARNING: using cross tools not prefixed with host triplet
mcc: error: no input files

make: make -j2 all
../../Python/initconfig.c:2360:27: warning: format specifies type 'wint_t' (aka 'int') but the argument has type 'wint_t' (aka 'unsigned int') [-Wformat]
    printf(usage_envvars, (wint_t)DELIM, (wint_t)DELIM, PYTHONHOMEHELP);
           ~~~~~~~~~~~~~  ^~~~~~~~~~~~~
../../Python/initconfig.c:145:18: note: format string is defined here
"PYTHONPATH   : '%lc'-separated list of directories prefixed to the\n"
                 ^~~
                 %c
../../Python/initconfig.c:2360:42: warning: format specifies type 'wint_t' (aka 'int') but the argument has type 'wint_t' (aka 'unsigned int') [-Wformat]
    printf(usage_envvars, (wint_t)DELIM, (wint_t)DELIM, PYTHONHOMEHELP);
           ~~~~~~~~~~~~~                 ^~~~~~~~~~~~~
../../Python/initconfig.c:148:58: note: format string is defined here
"PYTHONHOME   : alternate <prefix> directory (or <prefix>%lc<exec_prefix>).\n"
                                                         ^~~
                                                         %c
2 warnings generated.
../../Modules/expat/xmlparse.c:3116:9: warning: code will never be executed [-Wunreachable-code]
        parser->m_characterDataHandler(parser->m_handlerArg, parser->m_dataBuf,
        ^~~~~~
../../Modules/expat/xmlparse.c:3115:16: note: silence by adding parentheses to mark code as explicitly dead
      else if (0 && parser->m_characterDataHandler)
               ^
               /* DISABLES CODE */ ( )
../../Modules/expat/xmlparse.c:4059:9: warning: code will never be executed [-Wunreachable-code]
        parser->m_characterDataHandler(parser->m_handlerArg, parser->m_dataBuf,
        ^~~~~~
../../Modules/expat/xmlparse.c:4058:16: note: silence by adding parentheses to mark code as explicitly dead
      else if (0 && parser->m_characterDataHandler)
               ^
               /* DISABLES CODE */ ( )
../../Modules/expat/xmlparse.c:7703:11: warning: format specifies type 'int' but the argument has type 'ptrdiff_t' (aka 'long') [-Wformat]
          bytesMore, (account == XML_ACCOUNT_DIRECT) ? "DIR" : "EXP",
          ^~~~~~~~~
3 warnings generated.
../../Modules/socketmodule.c:4047:33: warning: comparison of integers of different signs: 'unsigned long' and 'long' [-Wsign-compare]
         cmsgh != NULL; cmsgh = CMSG_NXTHDR(&msg, cmsgh)) {
                                ^~~~~~~~~~~~~~~~~~~~~~~~
/opt/buildbot/.emscripten_cache/sysroot/include/sys/socket.h:356:44: note: expanded from macro 'CMSG_NXTHDR'
        __CMSG_LEN(cmsg) + sizeof(struct cmsghdr) >= __MHDR_END(mhdr) - (unsigned char *)(cmsg) \
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../Modules/socketmodule.c:4100:33: warning: comparison of integers of different signs: 'unsigned long' and 'long' [-Wsign-compare]
         cmsgh != NULL; cmsgh = CMSG_NXTHDR(&msg, cmsgh)) {
                                ^~~~~~~~~~~~~~~~~~~~~~~~
/opt/buildbot/.emscripten_cache/sysroot/include/sys/socket.h:356:44: note: expanded from macro 'CMSG_NXTHDR'
        __CMSG_LEN(cmsg) + sizeof(struct cmsghdr) >= __MHDR_END(mhdr) - (unsigned char *)(cmsg) \
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../Modules/socketmodule.c:4724:54: warning: comparison of integers of different signs: 'unsigned long' and 'long' [-Wsign-compare]
            cmsgh = (i == 0) ? CMSG_FIRSTHDR(&msg) : CMSG_NXTHDR(&msg, cmsgh);
                                                     ^~~~~~~~~~~~~~~~~~~~~~~~
/opt/buildbot/.emscripten_cache/sysroot/include/sys/socket.h:356:44: note: expanded from macro 'CMSG_NXTHDR'
        __CMSG_LEN(cmsg) + sizeof(struct cmsghdr) >= __MHDR_END(mhdr) - (unsigned char *)(cmsg) \
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 warnings generated.
../../Modules/_sqlite/connection.c:2197:19: warning: result of comparison of constant 9223372036854775807 with expression of type 'Py_ssize_t' (aka 'long') is always false [-Wtautological-constant-out-of-range-compare]
    if (data->len > 9223372036854775807) {  // (1 << 63) - 1
        ~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~
1 warning generated.
mcc: warning: USE_PTHREADS + ALLOW_MEMORY_GROWTH may run non-wasm code slowly, see https://github.com/WebAssembly/design/issues/1271 [-Wpthreads-mem-growth]

make: *** [Makefile:1912: buildbottest] Error 2

Cannot open file '/opt/buildbot/bcannon-wasm/3.x.bcannon-wasm.emscripten-node-pthreads/build/build/build_oot/host/test-results.xml' for upload

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot wasm32-wasi 3.x has failed when building commit ced13c9.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/1046/builds/1540) and take a look at the build logs.
  4. Check if the failure is related to this commit (ced13c9) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/1046/builds/1540

Failed tests:

  • test_inspect

Failed subtests:

  • test_getasyncgenlocals_empty - test.test_inspect.TestGetAsyncGenState.test_getasyncgenlocals_empty
  • test_easy_debugging - test.test_inspect.TestGetAsyncGenState.test_easy_debugging
  • test_suspended - test.test_inspect.TestGetAsyncGenState.test_suspended
  • test_getasyncgenlocals - test.test_inspect.TestGetAsyncGenState.test_getasyncgenlocals
  • test_closed_after_exhaustion - test.test_inspect.TestGetAsyncGenState.test_closed_after_exhaustion
  • test_getasyncgenlocals_error - test.test_inspect.TestGetAsyncGenState.test_getasyncgenlocals_error
  • test_created - test.test_inspect.TestGetAsyncGenState.test_created
  • test_closed_after_immediate_exception - test.test_inspect.TestGetAsyncGenState.test_closed_after_immediate_exception
  • test_running - test.test_inspect.TestGetAsyncGenState.test_running

Summary of the results of the build (if available):

== Tests result: FAILURE ==

325 tests OK.

10 slowest tests:

  • test_compile: 6 min 4 sec
  • test_math: 1 min 28 sec
  • test_tokenize: 47.8 sec
  • test_lib2to3: 31.6 sec
  • test_unparse: 29.4 sec
  • test_hashlib: 24.0 sec
  • test_capi: 22.9 sec
  • test_unicodedata: 16.5 sec
  • test_pickle: 13.8 sec
  • test_decimal: 12.9 sec

1 test failed:
test_inspect

108 tests skipped:
test__xxinterpchannels test__xxsubinterpreters test_asyncgen
test_asyncio test_bz2 test_check_c_globals test_clinic
test_cmd_line test_concurrent_futures test_contextlib_async
test_ctypes test_curses test_dbm_gnu test_dbm_ndbm test_devpoll
test_doctest test_docxmlrpc test_dtrace test_embed test_epoll
test_faulthandler test_fcntl test_file_eintr test_fork1
test_ftplib test_gdb test_grp test_gzip test_httplib
test_httpservers test_idle test_imaplib test_interpreters
test_ioctl test_kqueue test_launcher test_lzma test_mailbox
test_mmap test_msilib test_multiprocessing_fork
test_multiprocessing_forkserver test_multiprocessing_main_handling
test_multiprocessing_spawn test_nis test_openpty test_ossaudiodev
test_pdb test_peg_generator test_perf_profiler test_pipes
test_poll test_poplib test_pty test_pwd test_queue test_readline
test_regrtest test_repl test_resource test_select test_selectors
test_smtplib test_smtpnet test_socket test_socketserver test_spwd
test_sqlite3 test_ssl test_stable_abi_ctypes test_startfile
test_subprocess test_sys_settrace test_syslog test_tcl
test_telnetlib test_thread test_threadedtempfile test_threading
test_threading_local test_tix test_tkinter test_tools test_ttk
test_ttk_textonly test_turtle test_urllib test_urllib2
test_urllib2_localnet test_urllib2net test_urllib_response
test_urllibnet test_venv test_wait3 test_wait4 test_webbrowser
test_winconsoleio test_winreg test_winsound test_wmi test_wsgiref
test_xmlrpc test_xmlrpc_net test_xxlimited test_zipfile64
test_zipimport_support test_zlib test_zoneinfo
0:08:19 load avg: 1.85
0:08:19 load avg: 1.85 Re-running failed tests is not supported with --python host runner option.

Total duration: 8 min 19 sec

Click to see traceback logs
Traceback (most recent call last):
  File "/Lib/unittest/async_case.py", line 85, in _callSetUp
    self._asyncioRunner.get_loop()
  File "/Lib/asyncio/runners.py", line 83, in get_loop
    self._lazy_init()
  File "/Lib/asyncio/runners.py", line 137, in _lazy_init
    self._loop = events.new_event_loop()
                 ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Lib/asyncio/events.py", line 819, in new_event_loop
    return get_event_loop_policy().new_event_loop()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Lib/asyncio/events.py", line 716, in new_event_loop
    return self._loop_factory()
           ^^^^^^^^^^^^^^^^^^^^
  File "/Lib/asyncio/unix_events.py", line 64, in __init__
    super().__init__(selector)
  File "/Lib/asyncio/selector_events.py", line 66, in __init__
    self._make_self_pipe()
  File "/Lib/asyncio/selector_events.py", line 120, in _make_self_pipe
    self._ssock, self._csock = socket.socketpair()
                               ^^^^^^^^^^^^^^^^^^^
  File "/Lib/socket.py", line 632, in socketpair
    lsock = socket(family, type, proto)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Lib/socket.py", line 233, in __init__
    _socket.socket.__init__(self, family, type, proto, fileno)
OSError: [Errno 58] Not supported


Traceback (most recent call last):
  File "/Lib/asyncio/base_events.py", line 705, in __del__
    self.close()
  File "/Lib/asyncio/unix_events.py", line 68, in close
    super().close()
  File "/Lib/asyncio/selector_events.py", line 104, in close
    self._close_self_pipe()
  File "/Lib/asyncio/selector_events.py", line 111, in _close_self_pipe
    self._remove_reader(self._ssock.fileno())
                        ^^^^^^^^^^^
AttributeError: '_UnixSelectorEventLoop' object has no attribute '_ssock'
Warning -- Unraisable exception
Exception ignored in: <function BaseEventLoop.__del__ at 0xf59e08>
Traceback (most recent call last):
  File "/Lib/asyncio/base_events.py", line 705, in __del__
    self.close()
  File "/Lib/asyncio/unix_events.py", line 68, in close
    super().close()
  File "/Lib/asyncio/selector_events.py", line 104, in close
    self._close_self_pipe()
  File "/Lib/asyncio/selector_events.py", line 111, in _close_self_pipe
    self._remove_reader(self._ssock.fileno())
                        ^^^^^^^^^^^
AttributeError: '_UnixSelectorEventLoop' object has no attribute '_ssock'
Warning -- Unraisable exception
Exception ignored in: <function BaseEventLoop.__del__ at 0xf59e08>
Traceback (most recent call last):
  File "/Lib/asyncio/base_events.py", line 705, in __del__
    self.close()
  File "/Lib/asyncio/unix_events.py", line 68, in close
    super().close()
  File "/Lib/asyncio/selector_events.py", line 104, in close
    self._close_self_pipe()
  File "/Lib/asyncio/selector_events.py", line 111, in _close_self_pipe
    self._remove_reader(self._ssock.fileno())
                        ^^^^^^^^^^^
AttributeError: '_UnixSelectorEventLoop' object has no attribute '_ssock'
Warning -- Unraisable exception
Exception ignored in: <function BaseEventLoop.__del__ at 0xf59e08>
Traceback (most recent call last):
  File "/Lib/asyncio/base_events.py", line 705, in __del__
    self.close()
  File "/Lib/asyncio/unix_events.py", line 68, in close
    super().close()
  File "/Lib/asyncio/selector_events.py", line 104, in close
    self._close_self_pipe()
  File "/Lib/asyncio/selector_events.py", line 111, in _close_self_pipe
    self._remove_reader(self._ssock.fileno())
                        ^^^^^^^^^^^
AttributeError: '_UnixSelectorEventLoop' object has no attribute '_ssock'
Warning -- Unraisable exception
Exception ignored in: <function BaseEventLoop.__del__ at 0xf59e08>
Traceback (most recent call last):
  File "/Lib/asyncio/base_events.py", line 705, in __del__
    self.close()
  File "/Lib/asyncio/unix_events.py", line 68, in close
    super().close()
  File "/Lib/asyncio/selector_events.py", line 104, in close
    self._close_self_pipe()
  File "/Lib/asyncio/selector_events.py", line 111, in _close_self_pipe
    self._remove_reader(self._ssock.fileno())
                        ^^^^^^^^^^^
AttributeError: '_UnixSelectorEventLoop' object has no attribute '_ssock'
Warning -- Unraisable exception
Exception ignored in: <function BaseEventLoop.__del__ at 0xf59e08>
Traceback (most recent call last):
  File "/Lib/asyncio/base_events.py", line 705, in __del__
    self.close()
  File "/Lib/asyncio/unix_events.py", line 68, in close
    super().close()
  File "/Lib/asyncio/selector_events.py", line 104, in close
    self._close_self_pipe()
  File "/Lib/asyncio/selector_events.py", line 111, in _close_self_pipe
    self._remove_reader(self._ssock.fileno())
                        ^^^^^^^^^^^
AttributeError: '_UnixSelectorEventLoop' object has no attribute '_ssock'
Warning -- Unraisable exception
Exception ignored in: <function BaseEventLoop.__del__ at 0xf59e08>
Traceback (most recent call last):
  File "/Lib/asyncio/base_events.py", line 705, in __del__
    self.close()
  File "/Lib/asyncio/unix_events.py", line 68, in close
    super().close()
  File "/Lib/asyncio/selector_events.py", line 104, in close
    self._close_self_pipe()
  File "/Lib/asyncio/selector_events.py", line 111, in _close_self_pipe
    self._remove_reader(self._ssock.fileno())
                        ^^^^^^^^^^^
AttributeError: '_UnixSelectorEventLoop' object has no attribute '_ssock'
Warning -- Unraisable exception
Exception ignored in: <function BaseEventLoop.__del__ at 0xf59e08>
Traceback (most recent call last):
  File "/Lib/asyncio/base_events.py", line 705, in __del__
    self.close()
  File "/Lib/asyncio/unix_events.py", line 68, in close
    super().close()
  File "/Lib/asyncio/selector_events.py", line 104, in close
    self._close_self_pipe()
  File "/Lib/asyncio/selector_events.py", line 111, in _close_self_pipe
    self._remove_reader(self._ssock.fileno())
                        ^^^^^^^^^^^
AttributeError: '_UnixSelectorEventLoop' object has no attribute '_ssock'
Warning -- Unraisable exception
Exception ignored in: <function BaseEventLoop.__del__ at 0xf59e08>
Traceback (most recent call last):
  File "/Lib/asyncio/base_events.py", line 705, in __del__
    self.close()
  File "/Lib/asyncio/unix_events.py", line 68, in close
    super().close()
  File "/Lib/asyncio/selector_events.py", line 104, in close
    self._close_self_pipe()
  File "/Lib/asyncio/selector_events.py", line 111, in _close_self_pipe
    self._remove_reader(self._ssock.fileno())
                        ^^^^^^^^^^^
AttributeError: '_UnixSelectorEventLoop' object has no attribute '_ssock'
k

@tkren
Copy link
Contributor Author

tkren commented Mar 11, 2023

Buildbot wasm32 worker seem to be unhappy, asyncio loop initialization fails now in test_inspect. I'll have a look and check how to fix this in a follow up PR

tkren added a commit to tkren/cpython that referenced this pull request Mar 11, 2023
Skip `TestGetAsyncGenState` and restoring of the default event loop
policy in `test_inspect` if platform lacks working socket support.

Fixes python#11590
tkren added a commit to tkren/cpython that referenced this pull request Mar 11, 2023
Skip `TestGetAsyncGenState` and restoring of the default event loop
policy in `test_inspect` if platform lacks working socket support.

Fixes python#11590
tkren added a commit to tkren/cpython that referenced this pull request Mar 11, 2023
Skip `TestGetAsyncGenState` and restoring of the default event loop
policy in `test_inspect` if platform lacks working socket support.

Fixes python#11590
miss-islington pushed a commit that referenced this pull request Mar 11, 2023
…sockets (GH-102605)

Skip `TestGetAsyncGenState` and restoring of the default event loop policy in `test_inspect` if platform lacks working socket support.

Fixes #11590

Automerge-Triggered-By: GH:kumaraditya303
iritkatriel pushed a commit to iritkatriel/cpython that referenced this pull request Mar 12, 2023
iritkatriel pushed a commit to iritkatriel/cpython that referenced this pull request Mar 12, 2023
…rking sockets (pythonGH-102605)

Skip `TestGetAsyncGenState` and restoring of the default event loop policy in `test_inspect` if platform lacks working socket support.

Fixes python#11590

Automerge-Triggered-By: GH:kumaraditya303
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.12 bugs and security fixes topic-asyncio type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants