-
Notifications
You must be signed in to change notification settings - Fork 526
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
Resolve buffering issues in TeeStream
and capture_output
#3449
Conversation
Would love to see this resolved. |
Thanks! We have been having lots of issues with our testing infrastructure that we need to fix before we can get any actually functional PRs merged. Stay tuned! |
@@ -50,6 +50,32 @@ | |||
logger = logging.getLogger(__name__) | |||
|
|||
|
|||
class _SignalFlush(object): |
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.
(object)
- grrrrr
# NOTE: do not flush: we will test flush in the next test | ||
# t.STDOUT.flush() |
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.
Leftover?
Fixes #3084, fixes #3031, fixes #2845.
Summary/Motivation:
The HiGHS interface exposed some issues in the logic in
TeeStream
andcapture_output
where the two could end up fighting with each other. This PR should resolve all issues with console log management that we have been seeing with HiGHS.Changes proposed in this PR:
TeeStream
handle is propagated through tho the target output streamsTeeStream
tocapture_output
to prevent ending up with nestedTeeStream
instancesTeeStream
shoulddup
all target file descriptors so that subsequent context managers (likecapture_output
) don't commandeer them (causing a weird circular reference loop)capture_output
handles redirection (do not letredirect_fd
update thesys.stdout
/sys.stderr
streams)TeeStream
(andcapture_output
)capture_output
/TeeStream
for managing the console output.Legal Acknowledgement
By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution: