GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Regression tests pass but return unnecessary output (errors and warnings) · Issue #103186 · python/cpython

Regression tests pass but return unnecessary output (errors and warnings) #103186

New issue
Copy link
New issue
Copy link
Closed
Closed
Regression tests pass but return unnecessary output (errors and warnings)#103186
Copy link
Assignees
TabLand
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@TabLand
TabLand
opened on Apr 2, 2023
Issue body actions

Just built python for the first time using the devguide and I noticed some (deprecation) warnings and errors in the regression tests, even though all the tests (that ran) passed.

/opt/python/cpython/Lib/subprocess.py:849: RuntimeWarning: pass_fds overriding close_fds.
  warnings.warn("pass_fds overriding close_fds.", RuntimeWarning)
/opt/python/cpython/Lib/http/server.py:1168: DeprecationWarning: This process (pid=55357) is multi-threaded, use of fork() may lead to deadlocks in the child.
/opt/python/cpython/Lib/multiprocessing/popen_fork.py:66: DeprecationWarning: This process (pid=52754) is multi-threaded, use of fork() may lead to deadlocks in the child.
0:07:26 load avg: 8.24 [216/433] test_mailcap passed -- running: test_gdb (2 min 45 sec)
/opt/python/cpython/Lib/mailcap.py:228: UnsafeMailcapInput: Refusing to substitute MIME type 'audio/*' into a shell command.
  warnings.warn(msg, UnsafeMailcapInput)
/opt/python/cpython/Lib/mailcap.py:228: UnsafeMailcapInput: Refusing to substitute MIME type 'audio/*' into a shell command.
  warnings.warn(msg, UnsafeMailcapInput)
/opt/python/cpython/Lib/multiprocessing/popen_fork.py:66: DeprecationWarning: This process (pid=59900) is multi-threaded, use of fork() may lead to deadlocks in the child.
/opt/python/cpython/Lib/multiprocessing/popen_fork.py:66: DeprecationWarning: This process (pid=59550) is multi-threaded, use of fork() may lead to deadlocks in the child.
/opt/python/cpython/Lib/multiprocessing/popen_fork.py:66: DeprecationWarning: This process (pid=62788) is multi-threaded, use of fork() may lead to deadlocks in the child.
/opt/python/cpython/Lib/multiprocessing/popen_fork.py:66: DeprecationWarning: This process (pid=59550) is multi-threaded, use of fork() may lead to deadlocks in the child.
/opt/python/cpython/Lib/test/test_sys_settrace.py:1771: RuntimeWarning: assigning None to 1 unbound local
/opt/python/cpython/Lib/test/test_sys_settrace.py:1771: RuntimeWarning: assigning None to 2 unbound locals
: error: Incorrect number of arguments. uuid3 requires a namespace and a name. Run 'python -m uuid -h' for more information.
: error: Incorrect number of arguments. uuid3 requires a namespace and a name. Run 'python -m uuid -h' for more information.
: error: Incorrect number of arguments. uuid3 requires a namespace and a name. Run 'python -m uuid -h' for more information.
: error: Incorrect number of arguments. uuid3 requires a namespace and a name. Run 'python -m uuid -h' for more information.
0:16:23 load avg: 3.94 [405/433] test_warnings passed -- running: test_tools (59.0 sec)
/opt/python/cpython/Lib/test/test_warnings/__init__.py:390: UserWarning: Other types of warnings are not errors
  self.module.warn("Other types of warnings are not errors")
/opt/python/cpython/Lib/test/test_warnings/__init__.py:390: UserWarning: Other types of warnings are not errors
  self.module.warn("Other types of warnings are not errors")
/opt/python/cpython/Lib/test/test_xxtestfuzz.py:13: DeprecationWarning: module 'sre_compile' is deprecated
/opt/python/cpython/Lib/test/test_xxtestfuzz.py:13: DeprecationWarning: module 'sre_constants' is deprecated
CalledProcessError: Command '['/tmp/test_python_9xherg3o/tmpbgbtwgi2/cpython/python', '-c', 'import sysconfig; print(sysconfig.get_config_var("CONFIG_ARGS"))']' returned non-zero exit status 1.
ModuleNotFoundError: No module named '_sysconfigdata_d_linux_x86_64-linux-gnu'

Will attempt to investigate and patch these where appropriate.
Raising this issue as a base for my first pull request.
Any feedback is welcome!

Linked PRs

  • gh-103186: Fix or catch 'extra' stderr output from unittests #103196
  • gh-103186: In test_tools.freeze, fetch CONFIG_ARGS from original source directory #103213
  • gh-103186: assert in tests that UnsafeMailcapInput warnings are provided #103217
  • gh-103186: Suppress and assert expected RuntimeWarnings #103244
  • [3.12] gh-103186: Fix or catch 'extra' stderr output from unittests (GH-103196) #106605
  • [3.11] gh-103186: Fix or catch 'extra' stderr output from unittests (#103196) #106606
  • [3.12] gh-103186: In test_tools.freeze, fetch CONFIG_ARGS from original source directory (GH-103213) #106667
  • [3.11] gh-103186: assert in tests that UnsafeMailcapInput warnings are provided (GH-103217) #108800
  • [3.12] gh-103186: Suppress and assert expected RuntimeWarnings in test_sys_settrace (GH-103244) #109066
  • gh-103186: Suppress RuntimeWarning about unclosed async iterator in test_sys_settrace #109075
  • gh-103186: Remove debug print in test_sys_settrace #109077
  • [3.12] gh-103186: Remove debug print in test_sys_settrace (GH-109077) #109084
  • [3.11] gh-103186: Remove debug print in test_sys_settrace (GH-109077) #109085
  • [3.11] gh-103186: Suppress RuntimeWarning about unclosed async iterator in test_sys_settrace (GH-109075) #109086
  • gh-103186: Make test_generated_cases less noisy by default #109100
  • [3.12] gh-103186: Suppress RuntimeWarning about unclosed async iterator in test_sys_settrace (GH-109075) #109138
Reacted by Oleg Iarygin, sunmy2019, Alex Waygood, Erlend E. Aasland and Serhiy Storchaka

Activity

Next
  1. TabLand
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Apr 2, 2023
  2. TabLand commented on Apr 2, 2023

    @TabLand
    TabLand
    on Apr 2, 2023
    ContributorAuthor
    More actions

    First challenge, how do I assign this issue to myself?
    =D

  3. TabLand
    changed the title [-]Regression tests pass but return noisy output full of errors and warnings[/-] [+]Regression tests pass but return unnecessary output (errors and warnings)[/+] on Apr 2, 2023
  4. arhadthedev
    added
    testsTests in the Lib/test dirTests in the Lib/test dir
    on Apr 2, 2023
  5. arhadthedev commented on Apr 2, 2023

    @arhadthedev
    arhadthedev
    on Apr 2, 2023
    Member
    More actions

    It's an open project, no preliminary assignment is required.

    Reacted by Ijtaba Hussain and Alex Waygood
  6. TabLand commented on Apr 2, 2023

    @TabLand
    TabLand
    on Apr 2, 2023
    ContributorAuthor
    More actions

    test.log

  7. terryjreedy
    assigned
    TabLand
    on Apr 2, 2023
  8. terryjreedy commented on Apr 2, 2023

    @terryjreedy
    terryjreedy
    on Apr 2, 2023
    Member
    More actions

    Thank you for tackling this. Multiple PRs for one issue are allowed and for this issue I would encourage them -- even one for each test file or directory. The commit message, fix strategy and difficulty, possible controversy, reviewer/committers, and backports might vary for each.

    Reacted by sunmy2019, Ijtaba Hussain and Erlend E. Aasland
  9. TabLand commented on Apr 2, 2023

    @TabLand
    TabLand
    on Apr 2, 2023
    ContributorAuthor
    More actions

    Thanks Terry,

    I've managed to find fixes for some of the tests - will raise a few PR's shortly.
    Some tests (especially test_sys_settrace - RuntimeWarning: unbound locals ) have been fairly difficult to trace so far.

    I'll leave the deprecation warnings for the end; interestingly it's not immediately clear whether newer replacement code exists for all deprecated classes / methods / functions (e.g sre_compile / sre_constants)

  10. TabLand commented on Apr 3, 2023

    @TabLand
    TabLand
    on Apr 3, 2023
    ContributorAuthor
    More actions

    I've made some progress in tracing this error under test_tools.test_freeze_simple_script:

    # /opt/python/test/cpython/python -c 'import sysconfig; print(sysconfig.get_config_var("CONFIG_ARGS"))'
    CalledProcessError: Command '['/opt/python/test/cpython/python', '-c', 'import sysconfig; print(sysconfig.get_config_var("CONFIG_ARGS"))']' returned non-zero exit status 1.
    --- STDOUT ---
    
    --- STDERR ---
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/opt/python/test/cpython/Lib/sysconfig.py", line 740, in get_config_var
        return get_config_vars().get(name)
               ^^^^^^^^^^^^^^^^^
      File "/opt/python/test/cpython/Lib/sysconfig.py", line 723, in get_config_vars
        _init_config_vars()
      File "/opt/python/test/cpython/Lib/sysconfig.py", line 670, in _init_config_vars
        _init_posix(_CONFIG_VARS)
      File "/opt/python/test/cpython/Lib/sysconfig.py", line 536, in _init_posix
        _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ModuleNotFoundError: No module named '_sysconfigdata_d_linux_x86_64-linux-gnu'
    

    This is caused by the following file being unavailable in the intermediate build, despite being copied:
    /opt/python/test/cpython/build/lib.linux-x86_64-3.12-pydebug/_sysconfigdata_d_linux_x86_64-linux-gnu.py

    Looks like a timing issue in Tools/freeze/test/freeze.py where make clean is called before the CONFIG_ARGS lookup against the intermediate frozen build - it looks like this lookup depends on the build being complete. Will prep a change for this shortly (fetch this info from the original instead of the intermediate build)

  11. arhadthedev commented on Apr 6, 2023

    @arhadthedev
    arhadthedev
    on Apr 6, 2023
    Member
    More actions

    Closing as a duplicate of (now fixed) gh-102151.

  12. arhadthedev
    closed this as completedon Apr 6, 2023
  13. arhadthedev commented on Apr 6, 2023

    @arhadthedev
    arhadthedev
    on Apr 6, 2023
    Member
    More actions

    Reopening because I didn't notice there are three more attached PRs.

  14. arhadthedev
    reopened this on Apr 6, 2023
  15. iritkatriel
    added a commit that references this issue on Apr 6, 2023

    gh-103186: assert in tests that UnsafeMailcapInput warnings are provi…

    1724553
  16. 17 remaining items

  17. miss-islington
    added a commit that references this issue on Sep 7, 2023

    pythongh-103186: Remove debug print in test_sys_settrace (pythonGH-10…

    6fdf88d
  18. serhiy-storchaka
    added 4 commits that reference this issue on Sep 7, 2023

    gh-103186: Suppress RuntimeWarning about unclosed async iterator in t…

    d485551

    [3.11] pythongh-103186: Suppress RuntimeWarning about unclosed async …

    6009a04

    [3.11] gh-103186: Remove debug print in test_sys_settrace (GH-109077) (…

    12f40a4

    [3.11] gh-103186: Suppress RuntimeWarning about unclosed async iterat…

    49cc2e7
  19. serhiy-storchaka commented on Sep 7, 2023

    @serhiy-storchaka
    serhiy-storchaka
    on Sep 7, 2023
    Member
    More actions

    Opened separate issues #109096 (non-trivial, needs discussion) and #109098 (may be easy, but may need familiarity with the subject).

    Reacted by Ijtaba Hussain
  20. TabLand commented on Sep 7, 2023

    @TabLand
    TabLand
    on Sep 7, 2023
    ContributorAuthor
    More actions

    Thank you for sharing!
    I'll try and have a brief look into these...

  21. serhiy-storchaka
    added 2 commits that reference this issue on Sep 7, 2023

    pythongh-103186: Make test_generated_cases less noisy by default

    9eaf0cc

    gh-103186: Make test_generated_cases less noisy by default (GH-109100)

    f9f085c
  22. Yhg1s
    added 2 commits that reference this issue on Sep 8, 2023

    [3.12] gh-103186: Suppress and assert expected RuntimeWarnings in tes…

    29404b6

    [3.12] gh-103186: Remove debug print in test_sys_settrace (GH-109077) (…

    02e51f8
  23. miss-islington
    added a commit that references this issue on Sep 8, 2023

    pythongh-103186: Suppress RuntimeWarning about unclosed async iterato…

    400e2d5
  24. Yhg1s
    added a commit that references this issue on Sep 8, 2023

    [3.12] gh-103186: Suppress RuntimeWarning about unclosed async iterat…

    a1ba0e5
  25. TabLand commented on Oct 3, 2023

    @TabLand
    TabLand
    on Oct 3, 2023
    ContributorAuthor
    More actions

    Hi Team,
    It's probably safe to close this issue as all the original warnings no longer appear in the latest build.
    However, there are some new warnings I've seen in the latest build, will log a new issue to track and tackle them.

  26. TabLand
    closed this as completedon Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @TabLand
    TabLand

Labels

testsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.