From: Kevin Benton Date: Thu, 25 Jun 2015 23:57:30 +0000 (-0700) Subject: Remove ensure_dirs double-patch X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=0be1efad93734f11cd63fb3b7bd2983442ce1268;p=openstack-build%2Fneutron-build.git Remove ensure_dirs double-patch test_spawn_radvd called mock.patch on ensure_dirs after the setup method already patched it out. This causes issues when mock.patch.stopall() is called because the mocks are stored as a set and are unwound in a non-deterministic fashion.[1] So some of the time they will be undone correctly, but others will leave a monkey-patched in mock, causing the ensure_dir test to fail. 1. http://bugs.python.org/issue21239 Closes-Bug: #1467908 Change-Id: I321b5fed71dc73bd19b5099311c6f43640726cd4 --- diff --git a/neutron/tests/unit/agent/l3/test_agent.py b/neutron/tests/unit/agent/l3/test_agent.py index 5042ce287..d99b1c42d 100644 --- a/neutron/tests/unit/agent/l3/test_agent.py +++ b/neutron/tests/unit/agent/l3/test_agent.py @@ -2005,7 +2005,6 @@ class TestBasicRouterOperations(BasicRouterOperationsFramework): self.external_process_p.stop() self.ip_cls_p.stop() - ensure_dir = 'neutron.agent.linux.utils.ensure_dir' get_conf_file_name = 'neutron.agent.linux.utils.get_conf_file_name' get_pid_file_name = ('neutron.agent.linux.external_process.' 'ProcessManager.get_pid_file_name') @@ -2013,7 +2012,6 @@ class TestBasicRouterOperations(BasicRouterOperationsFramework): mock.patch(get_conf_file_name).start().return_value = conffile mock.patch(get_pid_file_name).start().return_value = pidfile - mock.patch(ensure_dir).start() execute = mock.patch(utils_execute).start() radvd = ra.DaemonMonitor(