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

test_interpreters has side effects on test_signal #88129

Closed
vstinner opened this issue Apr 27, 2021 · 7 comments
Closed

test_interpreters has side effects on test_signal #88129

vstinner opened this issue Apr 27, 2021 · 7 comments
Labels
3.10 only security fixes tests Tests in the Lib/test dir

Comments

@vstinner
Copy link
Member

BPO 43963
Nosy @vstinner, @Theelgirl
PRs
  • bpo-43963: import _signal in subinterpreter has no side effect #25674
  • bpo-43963: Add a module state to _signal #25676
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2021-04-27.23:51:03.344>
    created_at = <Date 2021-04-27.22:58:44.092>
    labels = ['tests', '3.10']
    title = 'test_interpreters has side effects on test_signal'
    updated_at = <Date 2021-05-03.18:55:28.123>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2021-05-03.18:55:28.123>
    actor = 'Theelgirl'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-04-27.23:51:03.344>
    closer = 'vstinner'
    components = ['Tests']
    creation = <Date 2021-04-27.22:58:44.092>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 43963
    keywords = ['patch']
    message_count = 7.0
    messages = ['392147', '392148', '392151', '392152', '392155', '392160', '392834']
    nosy_count = 2.0
    nosy_names = ['vstinner', 'Theelgirl']
    pr_nums = ['25674', '25676']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue43963'
    versions = ['Python 3.10']

    @vstinner
    Copy link
    Member Author

    vstinner@DESKTOP-DK7VBIL C:\vstinner\python\master>type bisect3
    test.test_signal.RaiseSignalTest.test_handler
    test.test_interpreters.TestInterpreterAttrs.test_main_id
    test.test_interpreters.TestInterpreterClose.test_from_sibling

    vstinner@DESKTOP-DK7VBIL C:\vstinner\python\master>python -m test test_interpreters test_signal --matchfile=bisect3 -v
    Running Debug|x64 interpreter...
    == CPython 3.10.0a7+ (heads/master:6bd9288b80, Apr 27 2021, 22:54:42) [MSC v.1928 64 bit (AMD64)]
    == Windows-10-10.0.19042-SP0 little-endian
    == cwd: C:\vstinner\python\master\build\test_python_5756æ
    == CPU count: 2
    == encodings: locale=cp1252, FS=utf-8
    0:00:00 Run tests sequentially
    0:00:00 [1/2] test_interpreters
    test_main_id (test.test_interpreters.TestInterpreterAttrs) ... ok
    test_from_sibling (test.test_interpreters.TestInterpreterClose) ... ok

    ----------------------------------------------------------------------

    Ran 2 tests in 0.277s

    OK
    0:00:00 [2/2] test_signal
    test_handler (test.test_signal.RaiseSignalTest) ... ERROR

    ======================================================================
    ERROR: test_handler (test.test_signal.RaiseSignalTest)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "C:\vstinner\python\master\lib\signal.py", line 47, in signal
        handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
    TypeError: signal handler must be signal.SIG_IGN, signal.SIG_DFL, or a callable object

    Ran 1 test in 0.004s

    FAILED (errors=1)
    test test_signal failed
    test_signal failed

    == Tests result: FAILURE ==

    1 test OK.

    1 test failed:
    test_signal

    Total duration: 689 ms
    Tests result: FAILURE

    @vstinner vstinner added 3.10 only security fixes tests Tests in the Lib/test dir labels Apr 27, 2021
    @vstinner
    Copy link
    Member Author

    See also bpo-43962: "test_interpreters: when TestInterpreterAttrs.test_id_type() is run alone, it fails with an assertion error".

    @vstinner
    Copy link
    Member Author

    See also bpo-43955: "Windows: Running the Python test suite sequentially is interrupted by (Pdb) prompt".

    @vstinner
    Copy link
    Member Author

    This issue is a follow-up of bpo-41713:

    commit 7f9b25a
    Author: Victor Stinner <vstinner@python.org>
    Date: Tue Nov 17 23:28:25 2020 +0100

    bpo-41713: Port _signal module to multi-phase init (GH-23355)
    
    Port the _signal extension module to the multi-phase initialization
    API (PEP-489).
    
    Co-Authored-By: Mohamed Koubaa <koubaa.m@gmail.com>
    

    @vstinner
    Copy link
    Member Author

    New changeset a09766d by Victor Stinner in branch 'master':
    bpo-43963: Fix import _signal in subinterpreters (GH-25674)
    a09766d

    @vstinner
    Copy link
    Member Author

    New changeset a5e6444 by Victor Stinner in branch 'master':
    bpo-43963: Add _signal module state (GH-25676)
    a5e6444

    @Theelgirl
    Copy link
    Mannequin

    Theelgirl mannequin commented May 3, 2021

    Sorry if I'm not supposed to open closed issues, however I believe there's a typo in the whatsnew page for this. In https://docs.python.org/3.10/whatsnew/changelog.html#changelog, the entry for bpo-43963 says "Importing the signal module in a subinterpreter has no longer side effects.", however I believe it should be "Importing the signal module in a subinterpreter no longer has side effects". The only difference is that "has" is moved after "no longer" instead of before.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.10 only security fixes tests Tests in the Lib/test dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant