A process stops printing data in a while loop when I use "Process" library to start this process in background

OS: Windows 11/Ubuntu 20.04.5 LTS
Python: 3.12.0/3.8.10
Robotframework: 7.0.1

I use “Process” library to start a process(print.py) in background. The process will keep writing data to a file in a while loop.
Start Process python print.py

However, the process will suddenly stop print data to a file due to unknown reason while running test cases.

Could you help check and solve this issue? Thanks.

Hi @fon1105 ,

Use Is Process Running to confirm that it’s actually stopped, then use Get Process Result if it’s not running or Wait For Process if it is.

Once you have the result, you can check ${result.rc}, ${result.stdout}, and${result.stderr} to see what happened.

Dave.

Hello,
Thank you for your reply.

The issue should be caused by the output buffers getting full because my script also writes something to the standard output.

If I redirect both stdout and stderr to file the issue will not happen.
Is there any limitation about the output buffers with robotframework?

If I manually run the original print.py in another terminal instead of robotframework, the issue will not happen.

Hi @fon1105,

I’m not sure what the buffer limits for stdout and stderr are if any, but if your script is putting a large amount of data to the console, redistricting to file is a good idea.

If you need to test the content of the output, you can read it in later with Get File or similar.

I usually use a file for the consol output so I’ve never seen this issue

Dave.