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
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')
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(