summaryrefslogtreecommitdiff
path: root/nova/test.py
diff options
context:
space:
mode:
Diffstat (limited to 'nova/test.py')
-rw-r--r--nova/test.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/nova/test.py b/nova/test.py
index e37967b06d..1cf605f10a 100644
--- a/nova/test.py
+++ b/nova/test.py
@@ -317,6 +317,13 @@ class TestCase(base.BaseTestCase):
# all other tests.
scheduler_utils.reset_globals()
+ # Wait for bare greenlets spawn_n()'ed from a GreenThreadPoolExecutor
+ # to finish before moving on from the test. When greenlets from a
+ # previous test remain running, they may attempt to access structures
+ # (like the database) that have already been torn down and can cause
+ # the currently running test to fail.
+ self.useFixture(nova_fixtures.GreenThreadPoolShutdownWait())
+
def _setup_cells(self):
"""Setup a normal cellsv2 environment.