summaryrefslogtreecommitdiff
path: root/nova/test.py
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2023-05-17 09:20:59 +0000
committerGerrit Code Review <review@openstack.org>2023-05-17 09:20:59 +0000
commit02a63e0f1b46bc2616d02c1742523b09936e7dd6 (patch)
tree642e56859dcd9bc79b29155c9ea9e47c20f111e2 /nova/test.py
parentb3fdd7ccf01bafb68e37a457f703b79119dbfa86 (diff)
parentc095cfe04e2c71efcfbfdd95948af080a98065e6 (diff)
downloadnova-master.tar.gz
Merge "tests: Use GreenThreadPoolExecutor.shutdown(wait=True)"HEADmaster
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.