Hi all,
I seem to be unable to use timeouts for the read from process command.
For demonstration purposes, I have the following program:
Hello.bat:
@echo Hello
@pause > nul
Now, I call it from Eggplant as follows:
Test.script:
open process "cmd.exe" with options {parameters: ["/c", "Hello.bat"]}
// Works fine
read from process "cmd.exe" until return
put the time && it
// !!! Blocks indefinitely instead of 5 seconds !!!
read from process "cmd.exe" timeout after 5 seconds
put the time && it
The first read works fine and outputs as expected:
03:25 PM Hello[returnKey]
However, the second read blocks indefinitely instead of terminating after 5 seconds.
The same behavior can also be observed when using the global readTimeout property instead of the timeout after clause.
Can someone help me get timeouts to work, please?
Even better: is there a way to poll for unread process data without blocking at all?
Any help would be appreciated!