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 — gh-76785: Add More Tests to test_interpreters.test_api by ericsnowcurrently · Pull Request #117662 · python/cpython

Conversation

@ericsnowcurrently

@ericsnowcurrently ericsnowcurrently commented Apr 9, 2024 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

This is a precursor to sorting out how we handle interpreters created directly via the C-API.

  • Issue: [subinterpreters] PEP 554 implementation: add interpreters module #76785

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
ericsnowcurrently added 18 commits April 8, 2024 15:54
@ericsnowcurrently
InterpreterError inherits from Exception.
bdd8d70
@ericsnowcurrently
Add _PyInterpreterState_GetIDObject().
940f24d
@ericsnowcurrently
Add _PyXI_NewInterpreter() and _PyXI_EndInterpreter().
528c6e3
@ericsnowcurrently
Add _testinternalcapi.next_interpreter_id().
0bd2e6b
@ericsnowcurrently
Add _testinternalcapi.exec_interpreter().
76e32cd
@ericsnowcurrently
Sketch out tests.
9b7bdc4
@ericsnowcurrently
Flesh out the tests.
fa28f9b
@ericsnowcurrently
Add PipeEnd.
5e31f6e
@ericsnowcurrently
Refactor _captured_script().
9111a83
@ericsnowcurrently
Finish the tests.
0c24e5c
@ericsnowcurrently
Add missing tests.
611fa31
@ericsnowcurrently
Add more capture/exec helpers.
bdc09f9
@ericsnowcurrently
Fill out the tests.
be85ff5
@ericsnowcurrently
Adjust the tests.
51f18f8
@ericsnowcurrently
Fix clean_up_interpreters().
b1f96d2
@ericsnowcurrently
Fix test_capi.test_misc.
cd61643
@ericsnowcurrently
external/unmanaged -> from_capi
7de523d
@ericsnowcurrently
Add a missing decorator.
11d38ab
@ericsnowcurrently ericsnowcurrently added the skip news label Apr 9, 2024
@ericsnowcurrently
ericsnowcurrently requested review from gvanrossum and markshannon as code owners April 9, 2024 01:35
@bedevere-app bedevere-app Bot mentioned this pull request Apr 9, 2024
[subinterpreters] PEP 554 implementation: add interpreters module #76785
Closed
@bedevere-app bedevere-app Bot added the awaiting core review label Apr 9, 2024
@ericsnowcurrently
Fix other tests.
1cf31b6
@ericsnowcurrently
ericsnowcurrently removed request for gvanrossum and markshannon April 9, 2024 14:57
ericsnowcurrently added 4 commits April 9, 2024 09:48
@ericsnowcurrently
Fix test_capi.
4421169
@ericsnowcurrently
Add _interpreters.capture_exception().
c75a115
@ericsnowcurrently
Raise ExecutionFailed when possible.
b00476d
@ericsnowcurrently
Handle OSError in the _running() script.
6a82a33
ericsnowcurrently added 5 commits April 10, 2024 14:38
@ericsnowcurrently
Add PyInterpreterState._whence.
11dae3d
@ericsnowcurrently
Fix up _testinternalcapi.
7c9a2b9
@ericsnowcurrently
Add PyInterpreterState.initialized.
e68654c
@ericsnowcurrently
Add tests for whence.
175080c
@ericsnowcurrently
Set interp-_ready on the main interpreter.
9db5a2b
@ericsnowcurrently ericsnowcurrently added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Apr 10, 2024
@bedevere-bot

bedevere-bot commented Apr 10, 2024

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @ericsnowcurrently for commit 9db5a2b 🤖

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Apr 10, 2024
@ericsnowcurrently
ericsnowcurrently merged commit 993c3cc into python:main Apr 11, 2024
@bedevere-app bedevere-app Bot removed the awaiting core review label Apr 11, 2024
@ericsnowcurrently
ericsnowcurrently deleted the more-interpreters-api-tests branch April 11, 2024 00:37
@bedevere-bot

bedevere-bot commented Apr 11, 2024

Copy link
Copy Markdown

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

Hi! The buildbot AMD64 Ubuntu NoGIL 3.x has failed when building commit 993c3cc.

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/1225/builds/1985) and take a look at the build logs.
  4. Check if the failure is related to this commit (993c3cc) 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/1225/builds/1985

Failed tests:

  • test_math
  • test_tools

Failed subtests:

  • test_flock - main.FNTLEINTRTest.test_flock
  • test_all - test.test_eintr.EINTRTests.test_all
  • test_create_connection_ssl_1 - test.test_asyncio.test_ssl.TestSSL.test_create_connection_ssl_1

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

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.nogil/build/Lib/test/test_asyncio/test_ssl.py", line 385, in test_create_connection_ssl_1
    run(client)
    ~~~^^^^^^^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.nogil/build/Lib/test/test_asyncio/test_ssl.py", line 380, in run
    self.loop.run_until_complete(_gather(*tasks))
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.nogil/build/Lib/asyncio/base_events.py", line 721, in run_until_complete
    return future.result()
           ~~~~~~~~~~~~~^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.nogil/build/Lib/test/test_asyncio/test_ssl.py", line 371, in _gather
    return await asyncio.gather(*tasks)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.nogil/build/Lib/test/test_asyncio/test_ssl.py", line 326, in client
    reader, writer = await asyncio.open_connection(
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<3 lines>...
        **extras)
        ^^^^^^^^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.nogil/build/Lib/asyncio/streams.py", line 48, in open_connection
    transport, _ = await loop.create_connection(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        lambda: protocol, host, port, **kwds)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.nogil/build/Lib/asyncio/base_events.py", line 1183, in create_connection
    transport, protocol = await self._create_connection_transport(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<2 lines>...
        ssl_shutdown_timeout=ssl_shutdown_timeout)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.nogil/build/Lib/asyncio/base_events.py", line 1216, in _create_connection_transport
    await waiter
ConnectionAbortedError: SSL handshake is taking longer than 30.0 seconds: aborting the connection


Traceback (most recent call last):
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.nogil/build/Lib/test/_test_eintr.py", line 535, in test_flock
    self._lock(fcntl.flock, "flock")
    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.nogil/build/Lib/test/_test_eintr.py", line 517, in _lock
    raise Exception("failed to sync child in %.1f sec" % dt)
Exception: failed to sync child in 300.7 sec


Traceback (most recent call last):
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.nogil/build/Lib/test/test_eintr.py", line 17, in test_all
    script_helper.run_test_script(script)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
  File "/home/ubuntu/buildarea/3.x.itamaro-ubuntu-aws.nogil/build/Lib/test/support/script_helper.py", line 316, in run_test_script
    raise AssertionError(f"{name} failed")
AssertionError: script _test_eintr.py failed
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

colesbury
colesbury reviewed Apr 11, 2024
View reviewed changes
Comment thread Lib/test/test_interpreters/test_api.py
Comment on lines +1417 to +1422
with self.subTest('main'):
expected = _interpreters.new_config('legacy')
expected.gil = 'own'
interpid, *_ = _interpreters.get_main()
config = _interpreters.get_config(interpid)
self.assert_ns_equal(config, expected)

@colesbury colesbury Apr 11, 2024

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

FYI, this is a duplicate of the above subtest

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ericsnowcurrently reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@ericsnowcurrently ericsnowcurrently Apr 11, 2024

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Looks like this is addressed in gh-117651. I'm fine with fixing it there since it's already done. 😄

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ericsnowcurrently ericsnowcurrently mentioned this pull request Apr 16, 2024
gh-76785: Fix Windows Refleak in test_interpreters #117913
Merged
ericsnowcurrently added a commit that referenced this pull request Apr 16, 2024
@ericsnowcurrently
gh-76785: Fix Windows Refleak in test_interpreters (gh-117913)
3831144
gh-117662 introduced some refleaks, or, rather, exposed some existing refleaks.  The leaks are coming when test.support.os_helper is imported in a "legacy" interpreter.  I've updated test.test_interpreters.utils to avoid importing os_helper, which fixes the leaks.  I'll address the root cause separately.
@ericsnowcurrently ericsnowcurrently mentioned this pull request Apr 16, 2024
[subinterpreters] Refleaks on Windows Under Specific Conditions #117936
Open
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
@ericsnowcurrently @diegorusso
pythongh-76785: Add More Tests to test_interpreters.test_api (pythong…
1cb5b6c
…h-117662)

In addition to the increase test coverage, this is a precursor to sorting out how we handle interpreters created directly via the C-API.
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
@ericsnowcurrently @diegorusso
pythongh-76785: Fix Windows Refleak in test_interpreters (pythongh-11…
8135251
…7913)

pythongh-117662 introduced some refleaks, or, rather, exposed some existing refleaks.  The leaks are coming when test.support.os_helper is imported in a "legacy" interpreter.  I've updated test.test_interpreters.utils to avoid importing os_helper, which fixes the leaks.  I'll address the root cause separately.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@colesbury colesbury colesbury left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@ericsnowcurrently @bedevere-bot @colesbury
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.