]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Remove ensure_dirs double-patch
authorKevin Benton <blak111@gmail.com>
Thu, 25 Jun 2015 23:57:30 +0000 (16:57 -0700)
committerKevin Benton <blak111@gmail.com>
Fri, 26 Jun 2015 00:06:02 +0000 (17:06 -0700)
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

neutron/tests/unit/agent/l3/test_agent.py

index 5042ce2874284ba519609cbe162b9302b7e099de..d99b1c42daa1a08e4d8367b67dbc0e870740207f 100644 (file)
@@ -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(