From d812c7eb3c7f0ce80c3548e9aec10b9fdc650a67 Mon Sep 17 00:00:00 2001 From: Matt Riedemann Date: Fri, 14 Jul 2017 11:40:13 -0400 Subject: [PATCH] Set wsgi.keep_alive=False globally for tests This was previously set for all functional API samples tests to try and fix a weird issue where requests and responses seemed to get mixed up between the compute API wsgi service fixture used in the API samples functional tests and the Placement API functional tests. However, we're also seeing these weird mixup issues in non-API samples tests, and there are other wsgi server fixtures that should be setting this, like the OSMetadataServer fixture. And there are functional tests that don't inherit from _IntegratedTestBase so we should just set this globally to be safe. Related-Bug: #1686109 Related-Bug: #1696834 Change-Id: Ie307e4d43be4b3e40dd75384ea6bb77598811713 --- nova/tests/functional/integrated_helpers.py | 1 - nova/tests/unit/conf_fixture.py | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/nova/tests/functional/integrated_helpers.py b/nova/tests/functional/integrated_helpers.py index cde46629178e..62cfb30de2ba 100644 --- a/nova/tests/functional/integrated_helpers.py +++ b/nova/tests/functional/integrated_helpers.py @@ -74,7 +74,6 @@ class _IntegratedTestBase(test.TestCase): # TODO(mriedem): Fix the functional tests to work with Neutron. self.flags(use_neutron=self.USE_NEUTRON) - self.flags(keep_alive=False, group="wsgi") nova.tests.unit.image.fake.stub_out_image_service(self) self._setup_services() diff --git a/nova/tests/unit/conf_fixture.py b/nova/tests/unit/conf_fixture.py index 63758cd10ed2..c037754362be 100644 --- a/nova/tests/unit/conf_fixture.py +++ b/nova/tests/unit/conf_fixture.py @@ -74,6 +74,11 @@ class ConfFixture(config_fixture.Config): self.conf.set_default('api_paste_config', paths.state_path_def('etc/nova/api-paste.ini'), group='wsgi') + # The functional tests run wsgi API services using fixtures and + # eventlet and we want one connection per request so things don't + # leak between requests from separate services in concurrently running + # tests. + self.conf.set_default('keep_alive', False, group="wsgi") # placement group self.conf.set_default('os_region_name', 'RegionOne',