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

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 94.30%. Comparing base (4d7d6b6) to head (b34ada8).
Report is 372 commits behind head on master.

Files Patch % Lines
httpie/internal/daemons.py 0.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1526      +/-   ##
==========================================
- Coverage   97.28%   94.30%   -2.99%     
==========================================
  Files          67      113      +46     
  Lines        4235     7688    +3453     
==========================================
+ Hits         4120     7250    +3130     
- Misses        115      438     +323     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

2 participants