Skip to content

Commit

Permalink
tests: Ensure input to subprocess is flushed
Browse files Browse the repository at this point in the history
Our `memray attach` processes send a message to a subprocess and then
block waiting for it to perform some action. We need to ensure that the
message is flushed, or we will deadlock.

Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
  • Loading branch information
godlygeek authored and pablogsal committed Oct 4, 2023
1 parent e334951 commit abbb033
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/integration/test_attach.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def run_process(cmd, wait_for_stderr=False):
print(exc.output)
raise
finally:
tracked_process.stdin.write("1\n")
print("1", file=tracked_process.stdin, flush=True)
if wait_for_stderr:
process_stderr = tracked_process.stderr.readline()
while "WARNING" in process_stderr:
Expand Down

0 comments on commit abbb033

Please sign in to comment.