Skip to content

test_asyncio.test_subprocess: test_stdin_broken_pipe() failed on GHA Windows x64 CI #109709

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

Closed
vstinner opened this issue Sep 22, 2023 · 2 comments
Labels
tests Tests in the Lib/test dir topic-asyncio

Comments

@vstinner
Copy link
Member

vstinner commented Sep 22, 2023

test_stdin_broken_pipe (test.test_asyncio.test_subprocess.SubprocessProactorTests.test_stdin_broken_pipe) ... FAIL

FAIL: test_stdin_broken_pipe (test.test_asyncio.test_subprocess.SubprocessProactorTests.test_stdin_broken_pipe)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\a\cpython\cpython\Lib\test\test_asyncio\test_subprocess.py", line 298, in test_stdin_broken_pipe
    self.assertRaises((BrokenPipeError, ConnectionResetError),
AssertionError: (<class 'BrokenPipeError'>, <class 'ConnectionResetError'>) not raised by run_until_complete

build: https://github.com/python/cpython/actions/runs/6268408487/job/17024556425?pr=109701

cc @sorcio

Linked PRs

@vstinner vstinner added tests Tests in the Lib/test dir topic-asyncio labels Sep 22, 2023
@github-project-automation github-project-automation bot moved this to Todo in asyncio Sep 22, 2023
@vstinner
Copy link
Member Author

The issue can be reproduced on FreeBSD with:

vstinner@freebsd$ ./python -m test test_asyncio.test_subprocess -m test_stdin_broken_pipe -v -j25 --forever
(...)
0:00:07 load avg: 7.48 [ 20/1] test_asyncio.test_subprocess failed (1 failure)
test_stdin_broken_pipe (test.test_asyncio.test_subprocess.SubprocessFastWatcherTests.test_stdin_broken_pipe) ... ok
test_stdin_broken_pipe (test.test_asyncio.test_subprocess.SubprocessPidfdWatcherTests.test_stdin_broken_pipe) ... skipped 'operating system does not support pidfds'
test_stdin_broken_pipe (test.test_asyncio.test_subprocess.SubprocessSafeWatcherTests.test_stdin_broken_pipe) ... ok
test_stdin_broken_pipe (test.test_asyncio.test_subprocess.SubprocessThreadedWatcherTests.test_stdin_broken_pipe) ... FAIL

======================================================================
FAIL: test_stdin_broken_pipe (test.test_asyncio.test_subprocess.SubprocessThreadedWatcherTests.test_stdin_broken_pipe)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/home/vstinner/python/main/Lib/test/test_asyncio/test_subprocess.py", line 298, in test_stdin_broken_pipe
    self.assertRaises((BrokenPipeError, ConnectionResetError),
AssertionError: (<class 'BrokenPipeError'>, <class 'ConnectionResetError'>) not raised by run_until_complete

----------------------------------------------------------------------
Ran 4 tests in 2.170s

FAILED (failures=1, skipped=1)
/usr/home/vstinner/python/main/Lib/asyncio/base_subprocess.py:125: ResourceWarning: unclosed transport <_UnixSubprocessTransport pid=2131 running stdin=<_UnixWritePipeTransport closed fd=7 closed>>
  _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
ResourceWarning: Enable tracemalloc to get the object allocation traceback
test test_asyncio.test_subprocess failed

vstinner added a commit to vstinner/cpython that referenced this issue Sep 22, 2023
Replace harcoded sleep of 500 ms with synchronization using a pipe.
vstinner added a commit to vstinner/cpython that referenced this issue Sep 22, 2023
Replace harcoded sleep of 500 ms with synchronization using a pipe.
vstinner added a commit to vstinner/cpython that referenced this issue Sep 22, 2023
Replace harcoded sleep of 500 ms with synchronization using a pipe.
@Shafiq-Githu Shafiq-Githu mentioned this issue Sep 22, 2023
vstinner added a commit to vstinner/cpython that referenced this issue Sep 22, 2023
Replace harcoded sleep of 500 ms with synchronization using a pipe.

Fix also Process._feed_stdin(): catch also BrokenPipeError on
stdin.write(input), not only on stdin.drain().
vstinner added a commit that referenced this issue Sep 22, 2023
Replace harcoded sleep of 500 ms with synchronization using a pipe.

Fix also Process._feed_stdin(): catch also BrokenPipeError on
stdin.write(input), not only on stdin.drain().
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Sep 22, 2023
Replace harcoded sleep of 500 ms with synchronization using a pipe.

Fix also Process._feed_stdin(): catch also BrokenPipeError on
stdin.write(input), not only on stdin.drain().
(cherry picked from commit cbbdf2c)

Co-authored-by: Victor Stinner <vstinner@python.org>
vstinner added a commit that referenced this issue Sep 22, 2023
…9735)

gh-109709: Fix asyncio test_stdin_broken_pipe() (#109710)

Replace harcoded sleep of 500 ms with synchronization using a pipe.

Fix also Process._feed_stdin(): catch also BrokenPipeError on
stdin.write(input), not only on stdin.drain().

(cherry picked from commit cbbdf2c)
csm10495 pushed a commit to csm10495/cpython that referenced this issue Sep 28, 2023
Replace harcoded sleep of 500 ms with synchronization using a pipe.

Fix also Process._feed_stdin(): catch also BrokenPipeError on
stdin.write(input), not only on stdin.drain().
@github-project-automation github-project-automation bot moved this from Todo to Done in asyncio Sep 29, 2023
Yhg1s pushed a commit that referenced this issue Oct 2, 2023
…109731)

gh-109709: Fix asyncio test_stdin_broken_pipe() (GH-109710)

Replace harcoded sleep of 500 ms with synchronization using a pipe.

Fix also Process._feed_stdin(): catch also BrokenPipeError on
stdin.write(input), not only on stdin.drain().
(cherry picked from commit cbbdf2c)

Co-authored-by: Victor Stinner <vstinner@python.org>
Glyphack pushed a commit to Glyphack/cpython that referenced this issue Sep 2, 2024
Replace harcoded sleep of 500 ms with synchronization using a pipe.

Fix also Process._feed_stdin(): catch also BrokenPipeError on
stdin.write(input), not only on stdin.drain().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir topic-asyncio
Projects
Status: Done
Development

No branches or pull requests

1 participant