Add timeout support to ansible-test. (#53302)

* Add timeout support to ansible-test.
* Fix ansible-test tar filename filter bug.
* Update timeouts used on Shippable.
* Kill subprocesses when parent process terminates.
* Require explicit use of env --show option.
This commit is contained in:
Matt Clay 2019-03-05 11:58:13 -08:00 committed by GitHub
parent 44b347aef5
commit a8d829d9c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 218 additions and 20 deletions

View file

@ -11,6 +11,10 @@ from lib.util import (
ABC,
)
from lib.constants import (
TIMEOUT_PATH,
)
# improve performance by disabling uid/gid lookups
tarfile.pwd = None
tarfile.grp = None
@ -45,6 +49,7 @@ class DefaultTarFilter(TarFilter):
self.ignore_files = (
'.gitignore',
'.gitdir',
TIMEOUT_PATH,
)
self.ignore_extensions = (
@ -58,7 +63,7 @@ class DefaultTarFilter(TarFilter):
:rtype: tarfile.TarInfo | None
"""
filename = os.path.basename(item.path)
name, ext = os.path.splitext(filename)
ext = os.path.splitext(filename)[1]
dirs = os.path.split(item.path)
if not item.isdir():
@ -68,7 +73,7 @@ class DefaultTarFilter(TarFilter):
if item.path.startswith('./docs/docsite/_build/'):
return None
if name in self.ignore_files:
if filename in self.ignore_files:
return None
if ext in self.ignore_extensions: