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

Intermittent regression in test_asyncio .. test_subprocess_shell since Python 3.11 #101922

Closed
fancidev opened this issue Feb 14, 2023 · 1 comment
Labels
OS-mac pending The issue will be closed if no feedback is provided stdlib Python modules in the Lib dir topic-asyncio type-bug An unexpected behavior, bug, or error

Comments

@fancidev
Copy link
Contributor

Background

I run a daily continuous integration test of python -m test.test_asyncio for Python 3.7 through 3.11 on Linux, MacOS, and Windows on GitHub Actions.

Issue

Since Python 3.11, the following test intermittently fails on MacOS: (see, for example, Python-3.11-PySide6-macos-latest)

python -m test.test_asyncio
  shell: /bin/bash -e {0}
  env:
    pythonLocation: /Users/runner/hostedtoolcache/Python/3.11.1/x64
    PKG_CONFIG_PATH: /Users/runner/hostedtoolcache/Python/3.11.1/x64/lib/pkgconfig
    Python_ROOT_DIR: /Users/runner/hostedtoolcache/Python/3.11.1/x64
    Python2_ROOT_DIR: /Users/runner/hostedtoolcache/Python/3.11.1/x64
    Python3_ROOT_DIR: /Users/runner/hostedtoolcache/Python/3.11.1/x64

...

======================================================================
FAIL: test_subprocess_shell (test.test_asyncio.test_events.SelectEventLoopTests.test_subprocess_shell)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/test/test_asyncio/test_events.py", line 1814, in test_subprocess_shell
    self.assertEqual(proto.data[1].rstrip(b'\r\n'), b'Python')
AssertionError: b'' != b'Python'

----------------------------------------------------------------------
Ran 2339 tests in 75.968s

FAILED (failures=1, skipped=80)

Observations

I note that:

  • This error only occurs on MacOS and only occurs with Python 3.11. That is, it never happened on Python 3.7 through 3.10 (regardless of OS), and it never happened on Linux or Windows (regardless of Python version).
  • This error can happen with SelectEventLoopTests, KqueueEventLoopTests, and PollEventLoopTests. This indicates the error is not related to the specific polling mechanism, which makes sense because it tests subprocess shell.

Analysis

I see asyncio's subprocess related code is modified in Python 3.11. But I'm unable to tell whether/how those modifications may cause the observed regression.

Impact

I don't use asyncio's subprocess functionality myself. So I report this error just for good order.

I wonder if you have observed similar error in your Continuous Integration tests?

@fancidev fancidev added the type-bug An unexpected behavior, bug, or error label Feb 14, 2023
@arhadthedev arhadthedev added topic-asyncio OS-mac stdlib Python modules in the Lib dir labels Feb 15, 2023
@github-project-automation github-project-automation bot moved this to Todo in asyncio Feb 15, 2023
@kumaraditya303
Copy link
Contributor

Duplicate of #100133

The fix is present in 3.11.2. @fancidev You need to upgrade to 3.11.2.

@kumaraditya303 kumaraditya303 added the pending The issue will be closed if no feedback is provided label Feb 15, 2023
@iritkatriel iritkatriel closed this as not planned Won't fix, can't repro, duplicate, stale Feb 19, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in asyncio Feb 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-mac pending The issue will be closed if no feedback is provided stdlib Python modules in the Lib dir topic-asyncio type-bug An unexpected behavior, bug, or error
Projects
Status: Done
Development

No branches or pull requests

4 participants