Skip to content
  • Dylan Baker's avatar
    framework/test/base.py: use subprocess32 for timeouts. · 09fc4303
    Dylan Baker authored
    
    
    Subprocess32 provides a backport of python 3.2's subprocess module,
    which has a timeout parameter for Popen.communicate. When the timeout
    runs out then an exception is raised, and when that exception is caught
    we can kill the process.
    
    This is fairly similar to the way the current timeout mechanism works,
    except that the current mechanism is not thread safe. Since one of the
    major features of piglit is that it offer's processes isolated
    concurrency of tests, it makes sense to make the effort to provide a
    timeout mechanism that supports concurrency. Unfortunately there isn't a
    good cross platform mechanism for this in python 2.x, even with
    subprocess 32 only *nix systems are supported, not windows.
    
    The big advantage of this is it allows consistent behavior between
    python 2.x and 3.x as we look toward the future and the possibility of
    using a hybrid approach to transition to python 3.x while maintaining
    2.x support until it's not needed.
    
    This patch look pretty substantial. It's not as big as it looks, since
    it adds some fairly big tests.
    
    Signed-off-by: default avatarDylan Baker <dylanx.c.baker@intel.com>
    09fc4303