robotframework / RIDE

Test data editor for Robot Framework
Apache License 2.0
958 stars 378 forks source link

Unable to flush the console output/subprocess stdout to RIDE's Message log. #2645

Closed manojpaul8 closed 11 months ago

manojpaul8 commented 11 months ago

Is there an option to flush the real time console output to the RIDE's message log without buffering ?

RIDE's message log shows the buffered console output now.

HelioGuilherme66 commented 11 months ago

@manojpaul8 What is the problem? How can we reproduce? Questions, questions...

manojpaul8 commented 11 months ago

Example: import subprocess from robot.api import logger

process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)

for line in process.stdout: logger.info(line.strip())

Above example does not print the output in the RIDE's message log real time. FYI, command I am using is a flashing command which runs for 20 mins and until the command execution is completed, we don't see the output.

Is there a way to flush the output to RIDE's message log ???

JFoederer commented 11 months ago

You could try os.set_blocking(process.stdout.fileno(), False) following the popen call. Linux only.

manojpaul8 commented 11 months ago

@JFoederer We are doing it on Windows machine.

HelioGuilherme66 commented 11 months ago

Above example does not print the output in the RIDE's message log real time.

Sorry, but this is not enough information. How would you run that code in RIDE? Is it in a Library? What test case step would call it. A simple example would do.

This type of conversation could happen in Slack or in Forum, then we can conclude it is a valid Issue report.

@manojpaul8 Please, at least, try to use the Forum.