Fixes flacky unit test wih py36
When running TestManilaCharm.test_install() with py36 sometimes test passes and sometimes throws and error while mocking methods. Seems to be an async race problem mocking a super method first. This was solved by avoiding mocking super method first. Closes-Bug: #1940552 Change-Id: Iac55321599b4866784a0631639a93fc828780647
This commit is contained in:
parent
e7ed915d2b
commit
310647c2bd
|
@ -95,10 +95,10 @@ class TestManilaCharm(Helper):
|
|||
return c
|
||||
|
||||
def test_install(self):
|
||||
self.patch('builtins.super', 'super')
|
||||
self.patch("subprocess.check_call", name="check_call")
|
||||
self.patch("charms_openstack.charm.OpenStackCharm.assess_status",
|
||||
name="assess_status")
|
||||
self.patch('builtins.super', name='super')
|
||||
c = manila.ManilaCharm()
|
||||
c.install()
|
||||
self.check_call.assert_called_once_with(["mkdir", "-p", "/etc/nova"])
|
||||
|
|
Loading…
Reference in New Issue