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-100192: add more `asyncio` subprocess tests by kumaraditya303 · Pull Request #100194 · python/cpython

Conversation

@kumaraditya303

@kumaraditya303 kumaraditya303 commented Dec 12, 2022 •
edited by bedevere-bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor
  • Issue: Add more tests for asyncio subprocess #100192

Sorry, something went wrong.

Uh oh!

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

All reactions
@kumaraditya303
add tests
d9d044b
@kumaraditya303 kumaraditya303 added topic-asyncio skip news labels Dec 12, 2022
@kumaraditya303
kumaraditya303 requested review from 1st1, asvetlov and gvanrossum as code owners December 12, 2022 11:49
@bedevere-bot bedevere-bot mentioned this pull request Dec 12, 2022
Add more tests for asyncio subprocess #100192
Closed
@bedevere-bot bedevere-bot added awaiting core review tests Tests in the Lib/test dir labels Dec 12, 2022
@python python deleted a comment from netlify Bot Dec 12, 2022
kumaraditya303
kumaraditya303 commented Dec 12, 2022
View reviewed changes
Comment thread Lib/test/test_asyncio/test_subprocess.py Resolved

Uh oh!

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

@kumaraditya303
fix tests on windows
1d96bf7
@kumaraditya303 kumaraditya303 mentioned this pull request Dec 15, 2022
GH-100133: fix asyncio subprocess losing stderr and stdout output #100154
Merged
gvanrossum
gvanrossum reviewed Dec 21, 2022
View reviewed changes
Comment thread Lib/test/test_asyncio/test_subprocess.py Outdated
Comment on lines +699 to +701
task = asyncio.create_task(proc.wait())
await asyncio.sleep(0)
self.assertEqual(task.result(), proc.returncode)

@gvanrossum gvanrossum Dec 21, 2022

Copy link
Copy Markdown
Member

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.

Why not await task instead of sleep(0) and task.result()? At this point we already know the process has exited, since the returncode is 0 on the previous line.

Sorry, something went wrong.

Uh oh!

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

All reactions

@kumaraditya303 kumaraditya303 Dec 22, 2022

Copy link
Copy Markdown
Contributor 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.

At this point we already know the process has exited, since the returncode is 0 on the previous line.

Yes, awaiting can take more than one cycle but we are checking that wait will be done immediately so using sleep(0) trick.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Lib/test/test_asyncio/test_subprocess.py Resolved

Uh oh!

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

Comment thread Lib/test/test_asyncio/test_subprocess.py Resolved

Uh oh!

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

Comment thread Lib/test/test_asyncio/test_subprocess.py Resolved

Uh oh!

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

kumaraditya303 added 3 commits December 22, 2022 13:42
@kumaraditya303
Merge branch 'main' of https://github.com/python/cpython into subproc…
d75002c
…ess-tests
@kumaraditya303
compare entire list
cb694ed
@kumaraditya303
refactor to helper
0a46c45
@kumaraditya303
kumaraditya303 requested a review from gvanrossum December 23, 2022 11:18
gvanrossum
gvanrossum approved these changes Dec 27, 2022
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels Dec 27, 2022
@kumaraditya303 kumaraditya303 linked an issue Dec 28, 2022 that may be closed by this pull request
Add more tests for asyncio subprocess #100192
Closed
@kumaraditya303
kumaraditya303 merged commit e97afef into python:main Dec 28, 2022
@bedevere-bot bedevere-bot removed the awaiting merge label Dec 28, 2022
@kumaraditya303
kumaraditya303 deleted the subprocess-tests branch December 28, 2022 04:12
@bedevere-bot

bedevere-bot commented Dec 28, 2022

Copy link
Copy Markdown

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

Hi! The buildbot AMD64 RHEL7 3.x has failed when building commit e97afef.

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

Failed tests:

  • test_asyncio

Failed subtests:

  • test_create_subprocess_env_exec - test.test_asyncio.test_subprocess.SubprocessThreadedWatcherTests.test_create_subprocess_env_exec
  • test_create_subprocess_env_exec - test.test_asyncio.test_subprocess.SubprocessSafeWatcherTests.test_create_subprocess_env_exec
  • test_create_subprocess_env_shell - test.test_asyncio.test_subprocess.SubprocessFastWatcherTests.test_create_subprocess_env_shell
  • test_create_subprocess_env_shell - test.test_asyncio.test_subprocess.SubprocessSafeWatcherTests.test_create_subprocess_env_shell
  • test_create_subprocess_env_shell - test.test_asyncio.test_subprocess.SubprocessThreadedWatcherTests.test_create_subprocess_env_shell
  • test_create_subprocess_env_exec - test.test_asyncio.test_subprocess.SubprocessFastWatcherTests.test_create_subprocess_env_exec

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

== Tests result: FAILURE then FAILURE ==

409 tests OK.

10 slowest tests:

  • test_concurrent_futures: 2 min 30 sec
  • test_multiprocessing_spawn: 2 min 8 sec
  • test_capi: 1 min 38 sec
  • test_multiprocessing_forkserver: 1 min 26 sec
  • test_multiprocessing_fork: 1 min 8 sec
  • test_asyncio: 1 min 8 sec
  • test_signal: 56.3 sec
  • test_tokenize: 50.3 sec
  • test_socket: 39.4 sec
  • test_io: 38.2 sec

1 test failed:
test_asyncio

23 tests skipped:
test_check_c_globals test_devpoll test_gdb test_idle test_ioctl
test_kqueue test_launcher test_msilib test_peg_generator
test_smtpnet test_ssl test_startfile test_tcl test_tix
test_tkinter test_ttk test_ttk_textonly test_turtle
test_winconsoleio test_winreg test_winsound test_wmi
test_zipfile64

1 re-run test:
test_asyncio

Total duration: 3 min 29 sec

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64/build/Lib/test/test_asyncio/test_subprocess.py", line 707, in test_create_subprocess_env_shell
    self.loop.run_until_complete(self.check_stdout_output(main(), b'bar'))
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64/build/Lib/asyncio/base_events.py", line 664, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64/build/Lib/test/test_asyncio/test_subprocess.py", line 692, in check_stdout_output
    self.assertEqual(stdout, output)
AssertionError: b'' != b'bar'


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64/build/Lib/test/test_asyncio/test_subprocess.py", line 719, in test_create_subprocess_env_exec
    self.loop.run_until_complete(self.check_stdout_output(main(), b'baz'))
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64/build/Lib/asyncio/base_events.py", line 664, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64/build/Lib/test/test_asyncio/test_subprocess.py", line 692, in check_stdout_output
    self.assertEqual(stdout, output)
AssertionError: b'' != b'baz'
All reactions

Sorry, something went wrong.

Uh oh!

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

@kumaraditya303

kumaraditya303 commented Dec 28, 2022 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor Author

Hi! The buildbot AMD64 RHEL7 3.x has failed when building commit e97afef.

Created #100569 to fix this, it failed because the buildbot uses env vars to pass shared library location.

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot

bedevere-bot commented Dec 28, 2022

Copy link
Copy Markdown

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

Hi! The buildbot AMD64 RHEL8 FIPS Only Blake2 Builtin Hash 3.x has failed when building commit e97afef.

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

Failed tests:

  • test_asyncio

Failed subtests:

  • test_create_subprocess_env_exec - test.test_asyncio.test_subprocess.SubprocessThreadedWatcherTests.test_create_subprocess_env_exec
  • test_create_subprocess_env_exec - test.test_asyncio.test_subprocess.SubprocessSafeWatcherTests.test_create_subprocess_env_exec
  • test_create_subprocess_env_shell - test.test_asyncio.test_subprocess.SubprocessFastWatcherTests.test_create_subprocess_env_shell
  • test_create_subprocess_env_shell - test.test_asyncio.test_subprocess.SubprocessSafeWatcherTests.test_create_subprocess_env_shell
  • test_create_subprocess_env_shell - test.test_asyncio.test_subprocess.SubprocessThreadedWatcherTests.test_create_subprocess_env_shell
  • test_create_subprocess_env_exec - test.test_asyncio.test_subprocess.SubprocessFastWatcherTests.test_create_subprocess_env_exec

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

== Tests result: FAILURE then FAILURE ==

416 tests OK.

10 slowest tests:

  • test_gdb: 6 min 55 sec
  • test_concurrent_futures: 2 min 43 sec
  • test_capi: 2 min 1 sec
  • test_asyncio: 1 min 53 sec
  • test_multiprocessing_spawn: 1 min 50 sec
  • test_multiprocessing_forkserver: 1 min 15 sec
  • test_tokenize: 1 min 7 sec
  • test_multiprocessing_fork: 59.2 sec
  • test_signal: 49.4 sec
  • test_socket: 45.6 sec

1 test failed:
test_asyncio

16 tests skipped:
test_check_c_globals test_devpoll test_ioctl test_kqueue
test_launcher test_msilib test_peg_generator test_startfile
test_tix test_tkinter test_ttk test_winconsoleio test_winreg
test_winsound test_wmi test_zipfile64

1 re-run test:
test_asyncio

Total duration: 9 min 54 sec

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-fips-x86_64.no-builtin-hashes-except-blake2/build/Lib/test/test_asyncio/test_subprocess.py", line 719, in test_create_subprocess_env_exec
    self.loop.run_until_complete(self.check_stdout_output(main(), b'baz'))
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-fips-x86_64.no-builtin-hashes-except-blake2/build/Lib/asyncio/base_events.py", line 664, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-fips-x86_64.no-builtin-hashes-except-blake2/build/Lib/test/test_asyncio/test_subprocess.py", line 692, in check_stdout_output
    self.assertEqual(stdout, output)
AssertionError: b'' != b'baz'


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-fips-x86_64.no-builtin-hashes-except-blake2/build/Lib/test/test_asyncio/test_subprocess.py", line 707, in test_create_subprocess_env_shell
    self.loop.run_until_complete(self.check_stdout_output(main(), b'bar'))
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-fips-x86_64.no-builtin-hashes-except-blake2/build/Lib/asyncio/base_events.py", line 664, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-fips-x86_64.no-builtin-hashes-except-blake2/build/Lib/test/test_asyncio/test_subprocess.py", line 692, in check_stdout_output
    self.assertEqual(stdout, output)
AssertionError: b'' != b'bar'
All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot

bedevere-bot commented Dec 28, 2022

Copy link
Copy Markdown

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

Hi! The buildbot AMD64 Ubuntu Shared 3.x has failed when building commit e97afef.

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

Failed tests:

  • test_asyncio

Failed subtests:

  • test_create_subprocess_env_exec - test.test_asyncio.test_subprocess.SubprocessThreadedWatcherTests.test_create_subprocess_env_exec
  • test_create_subprocess_env_exec - test.test_asyncio.test_subprocess.SubprocessSafeWatcherTests.test_create_subprocess_env_exec
  • test_create_subprocess_env_shell - test.test_asyncio.test_subprocess.SubprocessFastWatcherTests.test_create_subprocess_env_shell
  • test_create_subprocess_env_shell - test.test_asyncio.test_subprocess.SubprocessSafeWatcherTests.test_create_subprocess_env_shell
  • test_create_subprocess_env_shell - test.test_asyncio.test_subprocess.SubprocessThreadedWatcherTests.test_create_subprocess_env_shell
  • test_create_subprocess_env_exec - test.test_asyncio.test_subprocess.SubprocessFastWatcherTests.test_create_subprocess_env_exec

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

== Tests result: FAILURE then FAILURE ==

412 tests OK.

10 slowest tests:

  • test_tools: 8 min 37 sec
  • test_multiprocessing_spawn: 4 min 32 sec
  • test_concurrent_futures: 3 min 19 sec
  • test_capi: 3 min 8 sec
  • test_gdb: 2 min 46 sec
  • test_asyncio: 2 min 28 sec
  • test_tokenize: 1 min 49 sec
  • test_multiprocessing_forkserver: 1 min 43 sec
  • test_lib2to3: 1 min 38 sec
  • test_multiprocessing_fork: 1 min 26 sec

1 test failed:
test_asyncio

20 tests skipped:
test_check_c_globals test_devpoll test_idle test_ioctl test_kqueue
test_launcher test_msilib test_peg_generator test_startfile
test_tcl test_tix test_tkinter test_ttk test_ttk_textonly
test_turtle test_winconsoleio test_winreg test_winsound test_wmi
test_zipfile64

1 re-run test:
test_asyncio

Total duration: 34 min 2 sec

Click to see traceback logs
Traceback (most recent call last):
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_asyncio/test_subprocess.py", line 707, in test_create_subprocess_env_shell
    self.loop.run_until_complete(self.check_stdout_output(main(), b'bar'))
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/asyncio/base_events.py", line 664, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_asyncio/test_subprocess.py", line 692, in check_stdout_output
    self.assertEqual(stdout, output)
AssertionError: b'' != b'bar'


Traceback (most recent call last):
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_asyncio/test_subprocess.py", line 719, in test_create_subprocess_env_exec
    self.loop.run_until_complete(self.check_stdout_output(main(), b'baz'))
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/asyncio/base_events.py", line 664, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_asyncio/test_subprocess.py", line 692, in check_stdout_output
    self.assertEqual(stdout, output)
AssertionError: b'' != b'baz'
All reactions

Sorry, something went wrong.

Uh oh!

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@gvanrossum gvanrossum gvanrossum approved these changes
@1st1 1st1 Awaiting requested review from 1st1 1st1 is a code owner
@asvetlov asvetlov Awaiting requested review from asvetlov asvetlov is a code owner

Uh oh!

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

Assignees

No one assigned

Labels

skip news tests Tests in the Lib/test dir topic-asyncio

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Add more tests for asyncio subprocess

Uh oh!

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

3 participants

@kumaraditya303 @bedevere-bot @gvanrossum
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.