diff options
author | Benjamin Schubert <bschubert15@bloomberg.net> | 2019-12-02 14:29:12 +0000 |
---|---|---|
committer | Tom Pollard <tom.pollard@codethink.co.uk> | 2019-12-18 10:38:32 +0000 |
commit | 723d0d498e5dbe59acb9d71d2542e552336a4fa4 (patch) | |
tree | 454c6a217cfd22637ffda14041d6d9cda1f7d6f8 | |
parent | d1d898bdc60dc35ff618039775d53bb96774b836 (diff) | |
download | buildstream-723d0d498e5dbe59acb9d71d2542e552336a4fa4.tar.gz |
WIP
-rw-r--r-- | .gitlab-ci.yml | 6 | ||||
-rw-r--r-- | src/buildstream/_scheduler/scheduler.py | 9 | ||||
-rw-r--r-- | tox.ini | 34 |
3 files changed, 31 insertions, 18 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1fe25810a..1c605bdac 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -88,6 +88,12 @@ tests-centos-7.6: <<: *tests image: registry.gitlab.com/buildstream/buildstream-docker-images/testsuite-centos:7.6.1810-${DOCKER_IMAGE_VERSION} +tests-python-3.8-buster: + image: registry.gitlab.com/buildstream/buildstream-docker-images/testsuite-python:3.8-buster-chandan-python3-8-89265968 + <<: *tests + variables: + TOXENV: py38 + overnight-fedora-30-aarch64: image: registry.gitlab.com/buildstream/buildstream-docker-images/testsuite-fedora:aarch64-30-${DOCKER_IMAGE_VERSION} tags: diff --git a/src/buildstream/_scheduler/scheduler.py b/src/buildstream/_scheduler/scheduler.py index a45da82f9..4e66a034c 100644 --- a/src/buildstream/_scheduler/scheduler.py +++ b/src/buildstream/_scheduler/scheduler.py @@ -171,6 +171,14 @@ class Scheduler: # Hold on to the queues to process self.queues = queues + # NOTE: Enforce use of `SafeChildWatcher` as we generally don't want + # background threads. + # In Python 3.8+, `ThreadedChildWatcher` is the default watcher, and not `SafeChildWatcher` + # This needs to be done before we call `new_event_loop`, otherwise the loop will not be + # setup correctly with the watcher. + _watcher = asyncio.SafeChildWatcher() + asyncio.set_child_watcher(_watcher) + # Ensure that we have a fresh new event loop, in case we want # to run another test in this thread. self.loop = asyncio.new_event_loop() @@ -187,7 +195,6 @@ class Scheduler: # Watch casd while running to ensure it doesn't die self._casd_process = casd_process_manager.process - _watcher = asyncio.get_child_watcher() def abort_casd(pid, returncode): asyncio.get_event_loop().call_soon(self._abort_on_casd_failure, pid, returncode) @@ -2,7 +2,7 @@ # Tox global configuration # [tox] -envlist = py{35,36,37} +envlist = py{35,36,37,38} skip_missing_interpreters = true isolated_build = true @@ -14,22 +14,22 @@ isolated_build = true [testenv] usedevelop = # This is required by Cython in order to get coverage for cython files. - py{35,36,37}-!nocover: True + py{35,36,37,38}-!nocover: True commands = # Running with coverage reporting enabled - py{35,36,37}-!external-!nocover: pytest --basetemp {envtmpdir} --cov=buildstream --cov-config .coveragerc {posargs} - py{35,36,37}-!nocover: mkdir -p .coverage-reports + py{35,36,37,38}-!external-!nocover: pytest --basetemp {envtmpdir} --cov=buildstream --cov-config .coveragerc {posargs} + py{35,36,37,38}-!nocover: mkdir -p .coverage-reports external-!nocover: {envpython} {toxinidir}/tests/external_plugins.py {envtmpdir} --cov=buildstream --cov-append {posargs} - py{35,36,37}-!external-!nocover: mv {envtmpdir}/.coverage {toxinidir}/.coverage-reports/.coverage.{env:COVERAGE_PREFIX:}{envname} - py{35,36,37}-external-!nocover: - mv {envtmpdir}/.coverage {toxinidir}/.coverage-reports/.coverage.{env:COVERAGE_PREFIX:}{envname} + py{35,36,37,38}-!external-!nocover: mv {envtmpdir}/.coverage {toxinidir}/.coverage-reports/.coverage.{env:COVERAGE_PREFIX:}{envname} + py{35,36,37,38}-external-!nocover: - mv {envtmpdir}/.coverage {toxinidir}/.coverage-reports/.coverage.{env:COVERAGE_PREFIX:}{envname} # Running with coverage reporting disabled - py{35,36,37}-!external-nocover: pytest --basetemp {envtmpdir} {posargs} + py{35,36,37,38}-!external-nocover: pytest --basetemp {envtmpdir} {posargs} external-nocover: {envpython} {toxinidir}/tests/external_plugins.py {envtmpdir} {posargs} deps = - py{35,36,37}: -rrequirements/requirements.txt - py{35,36,37}: -rrequirements/dev-requirements.txt - py{35,36,37}: -rrequirements/plugin-requirements.txt + py{35,36,37,38}: -rrequirements/requirements.txt + py{35,36,37,38}: -rrequirements/dev-requirements.txt + py{35,36,37,38}: -rrequirements/plugin-requirements.txt git+https://gitlab.com/BuildStream/bst-plugins-experimental.git@5b004e5850ab0e987c00c681b2c768f6ae02586b # Only require coverage and pytest-cov when using it @@ -58,17 +58,17 @@ passenv = # These keys are not inherited by any other sections # setenv = - py{35,36,37}: COVERAGE_FILE = {envtmpdir}/.coverage - py{35,36,37}: BST_TEST_HOME = {envtmpdir} - py{35,36,37}: BST_TEST_XDG_CACHE_HOME = {envtmpdir}/cache - py{35,36,37}: BST_TEST_XDG_CONFIG_HOME = {envtmpdir}/config - py{35,36,37}: BST_TEST_XDG_DATA_HOME = {envtmpdir}/share + py{35,36,37,38}: COVERAGE_FILE = {envtmpdir}/.coverage + py{35,36,37,38}: BST_TEST_HOME = {envtmpdir} + py{35,36,37,38}: BST_TEST_XDG_CACHE_HOME = {envtmpdir}/cache + py{35,36,37,38}: BST_TEST_XDG_CONFIG_HOME = {envtmpdir}/config + py{35,36,37,38}: BST_TEST_XDG_DATA_HOME = {envtmpdir}/share # This is required to get coverage for Cython - py{35,36,37}-!nocover: BST_CYTHON_TRACE = 1 + py{35,36,37,38}-!nocover: BST_CYTHON_TRACE = 1 randomized: PYTEST_ADDOPTS="--random-order-bucket=global" whitelist_externals = - py{35,36,37}: + py{35,36,37,38}: mv mkdir |