def METHOD_NAME(testqueue, outqueue, threadname):
    start = time.time()
    while True:
        try:
            test = testqueue.get(block=True, timeout=TIMEOUT)
        except Empty:
            break
        log.info("Running test %s", test)
        try:
            p = Popen(os.path.abspath(test), stdout=PIPE, stderr=PIPE, env=os.environ)
            out, err = p.communicate()
        except Exception as e:
            log.exception(e)
            # Premature end
            break
        out, err = out.decode('utf-8'), err.decode('utf-8')
        output = ("# {0}\n".format(os.path.basename(test)), out, err)
        log.debug("Collected output %s", output)
        outqueue.put(output)
        testqueue.task_done()
    log.warning("Finished %s thread after %s seconds",
                threadname, round(time.time() - start, 3))