def startTimeoutThread(timeout):
    '''
    Start a thread which will eventually kill the process if the tests aren't finished
    after the timeout
    '''
    assert timeout is not None
    def killer():
        time.sleep(timeout)
        print >> sys.stderr
        print >> sys.stderr, ' *** Test failed to finish in %s seconds, aborting *** ' % timeout
        ufora.native.Tests.forceStackdump()

    t = threading.Thread(target=killer)
    t.daemon = True
    t.start()
dataset/ETHPy150Open ufora/ufora/ufora/test/UnitTestCommon.py/startTimeoutThread/original