[Gambas-user] Pre-release of Gambas 3.9.0
Benoît Minisini
gambas at ...1...
Sun Aug 21 17:02:06 CEST 2016
Le 21/08/2016 à 02:56, Jussi Lahtinen a écrit :
>> I tried on a Mint VirtualBox VM, and still have "Test passed!" as
>> result. Can you tell me exactly where it fails in the code?
>>
>
> Randomly in module mTest at lines 1685, 1694, 1704 and 1714. So at every
> occurrence of code 'If sTest <> "test" & gb.NewLine Then'.
> Every time it fails the string sTest is empty, this should never occur if
> the process has been ran. Or why else the string is empty?
>
> See attached screenshot.
>
> Now I realize that there is property "Blocking", which is false... so could
> it be that the process is read too early and process.wait only waits for
> some input..?
No. Blocking is for stream read & write methods. The Wait() method does
not take them into account. It just waits for the process end. The
problem is that on your system the input stream from the process is not
flushed.
If 'sTest' is empty, that means that the Read event is never called,
i.e. either the process output file descriptor is never ready to be
read, or is ready to be read but is void (it is theoritically possible).
I have run the four problematic tests thousands of time, and everything
works there.
Normally, when I (the interpreter) catch the process end, I carefully
send process Read events until the received pipe is flushed. So I don't
understand the behaviour on your system.
If other people could run the same four tests, it may help fix the
problem...
--
Benoît Minisini
More information about the User
mailing list