Hello core developers,

I need some help debugging run_parallel function, I think we have a bug
there. I am using job.parallel and I have a hard time to get return code
from it. It looks like this function is not returning anything, it is
always as 'None'.

In client/common_lib/utils.py I took a look at run_parallel function,
but I could not find where the problem is:

@return: a list of CmdResult objects
...
return [bg_job.result for bg_job in bg_jobs]


This is the test I did: 3 sleeptest, printing return code for each
separately, and finally printed job.parallel return code.

sleeptest function returns:

22:51:38 INFO | sleeptest function result:
22:51:38 INFO | True
22:51:38 INFO | ^^^ result ^^^
22:51:38 INFO | sleeptest GOOD


job parallel returns:

22:51:40 INFO | job parallel result:
22:51:40 INFO | None
22:51:40 INFO | ^^^ result ^^^


This is the control file used: 


import os, time, getpass
from socket import gethostname
from autotest_lib.client.bin import test_config, utils

AUTHOR = "Rafael Folco ([email protected])"
NAME = "Debugging Parallel Run"
TEST_TYPE = "client"
TEST_CLASS = "vio"
TEST_CATEGORY = "Functional"
TIME = "LONG"
DOC = """\
        debug result for parallel_run
        sleeptest
"""

def sleeptest(p_seconds, p_tag):
    """
    @return: result
    """
    result = job.run_test('sleeptest',seconds=p_seconds, tag=p_tag)
    print 'sleeptest function result:'
    print result
    print '^^^ result ^^^'

    if result:
        print 'sleeptest GOOD'
    else:
        print 'sleeptest FAIL'

    return result


result =
job.parallel([sleeptest,1,'sleep1'],[sleeptest,2,'sleep2'],[sleeptest,3,'sleep3'])

print 'job parallel result:'
print result
print '^^^ result ^^^'

Thanks in advance,

-Rafael



Rafael Folco
IBM Linux Technology Center



_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to