Conversation
There was a problem hiding this comment.
Pull request overview
Updates the realsense-viewer-tests live unit test wrapper to make the test output logs more readable/consistent by normalizing the viewer test runner’s console output.
Changes:
- Capture
realsense-viewer-testsstdout and stream it line-by-line after stripping ANSI escape sequences. - Replace the viewer’s
"[####] "prefix with an elapsed-time prefix ("[ x.xs] "), to make logs easier to interpret over time. - Keep filtering Mesa-specific
glCopyTexImage2Dwarnings from stderr.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| p = subprocess.Popen( cmd, | ||
| stdout=None, | ||
| stdout=subprocess.PIPE, | ||
| stderr=subprocess.PIPE, | ||
| env=env ) |
There was a problem hiding this comment.
Using both stdout=PIPE and stderr=PIPE while reading the streams sequentially (stdout loop completes before stderr loop starts) can deadlock if the child writes enough data to stderr to fill the OS pipe buffer. Consider either (a) redirecting stderr to STDOUT and processing a single stream, or (b) draining stderr concurrently (e.g., a dedicated thread/queue) while continuing to process stdout in real time.
There was a problem hiding this comment.
Unlikely to happen, but changed logic to two threads for future scalability
| elapsed = time.monotonic() - test_start | ||
| line = line[:m.start()] + f'[{elapsed:5.1f}s] '.encode() + line[m.end():] | ||
| sys.stdout.buffer.write( line ) | ||
| sys.stdout.buffer.flush() |
There was a problem hiding this comment.
Why do you flush in a loop?
the outcome is not the same as flushing once at the end?
No description provided.