From 067bf699941dbf4bda9623acd61e2c65f26e01b6 Mon Sep 17 00:00:00 2001 From: Ben Nemec Date: Thu, 25 Jul 2013 11:39:53 -0500 Subject: [PATCH] Set lock_path in tests When lock_path is not set, the synchronized decorator doesn't work properly. This change is required so that synchronized can throw an exception when that happens instead of failing silently. Change-Id: I341a522e59fda3feb8e41379d06ad3c8f97e5597 --- nova/test.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nova/test.py b/nova/test.py index babea87f47c0..db5d9d758bda 100644 --- a/nova/test.py +++ b/nova/test.py @@ -30,6 +30,7 @@ import copy import os import shutil import sys +import tempfile import uuid import fixtures @@ -251,6 +252,8 @@ class TestCase(testtools.TestCase): CONF.set_override('fatal_exception_format_errors', True) CONF.set_override('enabled', True, 'osapi_v3') CONF.set_override('force_dhcp_release', False) + # This will be cleaned up by the NestedTempfile fixture + CONF.set_override('lock_path', tempfile.mkdtemp()) def _restore_obj_registry(self): objects_base.NovaObject._obj_classes = self._base_test_obj_backup