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

Remove unnecessary process wait on MacOS (issue #1523) #1526

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cedel1
Copy link

@cedel1 cedel1 commented Aug 31, 2023

Remove process.communicate() in MacOS causing wait for subprocess even when the subprocess results were not used.

- remove process.communicate() in MacOS causing wait for subprocess even
when the subprocess results were not used.
@cedel1
Copy link
Author

cedel1 commented Aug 31, 2023

Hmm, I am surprised by the unrelated codecov check failure (especially since that part wasn't changed for quite some time, it fails on master and tests in previous PRs passed. Version changes?

@codecov-commenter
Copy link

codecov-commenter commented Aug 31, 2023

Codecov Report

Patch coverage is 89.91% of modified lines.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the GitHub App Integration for your organization. Read more.

Files Changed Coverage
httpie/output/ui/man_pages.py 0.00%
httpie/output/ui/rich_utils.py 0.00%
tests/test_binary.py ø
tests/test_defaults.py ø
tests/test_output.py ø
tests/test_parser_schema.py ø
tests/test_plugins_cli.py ø
tests/test_redirects.py ø
tests/test_regressions.py ø
tests/test_sessions.py ø
... and 90 more

📢 Thoughts on this report? Let us know!.

Comment on lines -212 to -217
@property
def command(self):
cmd = ' '.join(shlex.quote(arg) for arg in ['http', *self.args])
# pytest-httpbin to real httpbin.
return re.sub(r'127\.0\.0\.1:\d+', 'httpbin.org', cmd)

Copy link
Author

@cedel1 cedel1 Sep 1, 2023

Choose a reason for hiding this comment

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

pycodestyle (flake) complains that this redefines the command property a few lines above.

While it would be possible to correct that by removing the property from the list (and possibly adding setter and delete version of the @property to be able to change its value and/or delete the value), the only usage I found was a commented-out line a few lines below, so it made sense to me to just remove it completely, since it is basically unused code.

process = _start_process(args, env=process_context)
# Unlike windows, since we already completed the fork procedure
# we can simply join the process and wait for it.
process.communicate()
Copy link
Author

@cedel1 cedel1 Sep 1, 2023

Choose a reason for hiding this comment

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

Waited for the process and could send some data to it or return its return code - but nothing of the sort is being done, basically blocking until the process finishes. But since the purpose of the process is to be daemonized (or is possibly daemonized already), it doesn't seem to make sense.

@cedel1 cedel1 changed the title Remove unnecessary process wait on MacOS (#1523) Remove unnecessary process wait on MacOS (issue #1523) Sep 1, 2023
@cedel1 cedel1 marked this pull request as ready for review September 1, 2023 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants