con / duct

A helper to run a command, capture stdout/stderr and details about running
MIT License
1 stars 1 forks source link

Refactor: Introducing... TailPipe! #29

Closed asmacdo closed 1 month ago

asmacdo commented 1 month ago

TailPipe is nearly a drop-in replacement for TeeStream, but rather than "splitting the stream" we "tail -f" the stdout and stderr files as they are written.

BUG: should be streaming stdout and stderr, but instead we don't get output until the process ends.

Fixes: #27 Fixes #26 Fixes #25 Fixes https://github.com/con/duct/issues/21 Fixes https://github.com/con/duct/issues/10

asmacdo commented 1 month ago

Fixes: https://github.com/con/duct/issues/27 Fixes: https://github.com/con/duct/issues/26 Fixes: https://github.com/con/duct/issues/25 Fixes: https://github.com/con/duct/issues/21

yarikoptic commented 1 month ago

BUG: should be streaming stdout and stderr, but instead we don't get output until the process ends.

It might be a show stopper to the approach. Did you check if you could somehow tune up flushing or buffering behavior for those opened file(s) to ensure that stuff is dumped quickly after it is output by the process? or could you just check if that is the case and may be the reading process just is not informed/can't read it for some time/some reason?

asmacdo commented 1 month ago

BUG: should be streaming stdout and stderr, but instead we don't get output until the process ends.

Fixed-- I was using write without flush to see what happens ;)

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 67.92453% with 17 lines in your changes are missing coverage. Please review.

Project coverage is 47.97%. Comparing base (acd04d4) to head (d32a0ff).

:exclamation: Current head d32a0ff differs from pull request most recent head d9c3622. Consider uploading reports for the commit d9c3622 to get more accurate results

Files Patch % Lines
src/duct.py 67.92% 17 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #29 +/- ## =========================================== + Coverage 36.36% 47.97% +11.61% =========================================== Files 1 1 Lines 187 198 +11 Branches 32 33 +1 =========================================== + Hits 68 95 +27 + Misses 117 101 -16 Partials 2 2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

asmacdo commented 1 month ago

Fixes: https://github.com/con/duct/issues/10