dgrnbrg/autotest — comment on commit bd60399577cf89525b8ff2b40c62c977a319371c
File: server/hosts/ssh_host.py line 280
By jzupka:

There should be better way how to do this work.
When I try start this test (*)
"""
class async(test.test):
version = 2
def run_once(self, machine):
# Designate a label for the server side tests.

server = hosts.create_host(machine)
server_at = autotest.Autotest(server)
job = server.run_async("sleep 1 && echo maslo && sleep 3 && echo sadlo")
print job.wait_for()
"""
(*) from server part then wait_for makes dead lock. Because AsyncJob.wait_for()
try to wait for end of process. But this process never end because this wait for
ssh command which wait for "& read;".
And when I try to call job.kill_func() before AsyncJob.wait_for() then test fail because
AsyncJob.wait_for() call kill_func after process ends. This is a little deadlock.

If I try change last line of test to print job.wait_for(10). Then it works but it send bad result
to results "line 0: kill: (xxxxx) - No such process". This is no mistake but it doesn't look good.