-
Notifications
You must be signed in to change notification settings - Fork 108
: python/tests/test_actors.py: use context mgr for FD +sys.stdout/sys.stderr redirecction #1950
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
shayne-fletcher
wants to merge
3
commits into
meta-pytorch:main
from
shayne-fletcher:export-D87488586
Closed
: python/tests/test_actors.py: use context mgr for FD +sys.stdout/sys.stderr redirecction #1950
shayne-fletcher
wants to merge
3
commits into
meta-pytorch:main
from
shayne-fletcher:export-D87488586
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
@shayne-fletcher has exported this pull request. If you are a Meta employee, you can view the originating Diff in D87488586. |
shayne-fletcher
added a commit
to shayne-fletcher/monarch-1
that referenced
this pull request
Nov 20, 2025
….stderr redirecction (meta-pytorch#1950) Summary: do the stdio redirection with a context manager too (promised follow-up in the preceding diff) ``` async def test_example() -> None: with configured( enable_log_forwarding=True, enable_file_capture=True, tail_log_lines=100 ): with redirected_stdio(capture_stderr=True) as (stdout_path, stderr_path): ... ``` Differential Revision: D87488586
4c1ff1b to
c1a428e
Compare
…1932) Summary: replace env-var overrides with `configure`. relax `test_flush_logs_ipython` which before was over-constrained and consequently, highly flaky. Reviewed By: mariusae Differential Revision: D87449483
…ch#1946) Summary: following up on mariusae 's comment (https://www.internalfb.com/diff/D87449483?dst_version_fbid=2613910452329247&transaction_fbid=2002832840481448) remove manual config save/restore boilerplate: ``` config = get_configuration() enable_log_forwarding = config["enable_log_forwarding"] # ... etc configure(enable_log_forwarding=True, ...) try: # test code finally: configure(enable_log_forwarding=enable_log_forwarding, ...) ``` replace with a context manager phrasing: ``` with configured(enable_log_forwarding=True, enable_file_capture=True, tail_log_lines=100): # test code ``` i intend to follow this diff up with one for the FD + sys.stdout/sys.stderr redirection Reviewed By: thedavekwon Differential Revision: D87478665
….stderr redirecction (meta-pytorch#1950) Summary: do the stdio redirection with a context manager too (promised follow-up in the preceding diff) ``` async def test_example() -> None: with configured( enable_log_forwarding=True, enable_file_capture=True, tail_log_lines=100 ): with redirected_stdio(capture_stderr=True) as (stdout_path, stderr_path): ... ``` Differential Revision: D87488586
shayne-fletcher
added a commit
to shayne-fletcher/monarch-1
that referenced
this pull request
Nov 20, 2025
….stderr redirecction (meta-pytorch#1950) Summary: do the stdio redirection with a context manager too (promised follow-up in the preceding diff) ``` async def test_example() -> None: with configured( enable_log_forwarding=True, enable_file_capture=True, tail_log_lines=100 ): with redirected_stdio(capture_stderr=True) as (stdout_path, stderr_path): ... ``` Differential Revision: D87488586
92a2c4f to
69e1158
Compare
shayne-fletcher
added a commit
to shayne-fletcher/monarch-1
that referenced
this pull request
Nov 20, 2025
….stderr redirecction (meta-pytorch#1950) Summary: do the stdio redirection with a context manager too (promised follow-up in the preceding diff) ``` async def test_example() -> None: with configured( enable_log_forwarding=True, enable_file_capture=True, tail_log_lines=100 ): with redirected_stdio(capture_stderr=True) as (stdout_path, stderr_path): ... ``` Differential Revision: D87488586
|
This pull request has been merged in 80327ba. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
Summary:
do the stdio redirection with a context manager too (promised follow-up in the preceding diff)
Differential Revision: D87488586