def wait_process(urls, wait, stdout_path, stderr_path):

    print "Waiting for process to start and stay..."

    time_to_wait = flask_app.config.get("WEBLAB_STARTUP_TIME", wait or 20)

    start_time = time.time()

    # Wait for some seconds to start with. Apparently POPEN() did not immediately start the process in some instances.
    # This meant than when we ran the following check, it was mistakenly reported as a failure.
    # TODO: The 4 here is a magic number. This should probably be improved. Ideally, with a better way to detect
    # failures.
    time.sleep(7)

    while (time.time() - start_time) < time_to_wait:
        if _test_weblab(urls):
            break
        time.sleep(0.3)

    if not _test_weblab(urls):
        print open(stdout_path).read()
        print open(stderr_path).read()
        raise Exception("Weblab was apparently not started successfully (not running after %f seconds)" % (time.time() - start_time))
Go forward in history if possible.
dataset/ETHPy150Open weblabdeusto/weblabdeusto/tools/wcloud/wcloud/tasks/starter_tasks.py/wait_process--crossover with--dataset/ETHPy150Open kwikteam/phy/phy/cluster/manual/_history.py/History.forward