Browse Source

Reset global wsgi app state in unit test

Since I2bd360dcc6501feea7baf02d4510b282205fc061 there is a global state
set during the wsgi_app init making our unit test cases
non-deterministic based on the order of them. This patch makes sure
that the global state is reset for each test case.

Change-Id: Ie2ba746a7697a70fdbc6594f02257f78becfe962
Closes-Bug: #1921098
changes/91/782691/1
Balazs Gibizer 4 months ago
parent
commit
bc2c19bb2d
  1. 5
      nova/test.py

5
nova/test.py

@ -53,6 +53,7 @@ from oslotest import mock_fixture
from sqlalchemy.dialects import sqlite
import testtools
from nova.api.openstack import wsgi_app
from nova.compute import rpcapi as compute_rpcapi
from nova import context
from nova.db.sqlalchemy import api as sqlalchemy_api
@ -284,6 +285,10 @@ class TestCase(base.BaseTestCase):
self.useFixture(nova_fixtures.GenericPoisonFixture())
# make sure that the wsgi app is fully initialized for all testcase
# instead of only once initialized for test worker
wsgi_app.init_global_data.reset()
def _setup_cells(self):
"""Setup a normal cellsv2 environment.

Loading…
Cancel
Save