veyron/runtimes/google/rt: fix flakiness in TestSimpleServerDoubleSignal
The function returned by remoteCmdLoop(stdin) should be called with defer
instead of go: we need to avoid exiting the child program before the cmd loop
has exited. Otherwise, two bad things may happen:
(1) the loop may still be left spinning even when stdin has been closed (and
hence the read in the loop will fail).
(2) there's nothing preventing the child program from exiting upon receiving a
single signal. E.g. the child in TestSimpleServerDoubleSignal may exit upon
receiving the first signal, before the second signal arrives. This is probably
the cause behind http://go/vissues/421.
Change-Id: Ibc1110dd08e28fdd09443b473630c2384471720d
1 file changed