[hacking]Do not mock threading.Event
Such mock is too wide and will cause issues with our basic libraries and test infrastructure leading to race conditions and threads leaked across tests. We needed to remove a bunch of such mocks found by the new rule. In some cases we needed to make the mocking more specific for a given Event instance, in other case the mock was not needed at all and the test case was still not taking excessive time. Related-Bug: #2136815 Change-Id: I3ae3740eb07bade4e0883db3e02c0a81e92b9a36 Signed-off-by: Balazs Gibizer <gibi@redhat.com>
This commit is contained in:
@@ -81,6 +81,8 @@ Nova Specific Commandments
|
||||
from stdlib instead. E.g. eventlet.sleep => time.sleep
|
||||
- [N374] Don't use time.sleep(0) to trigger eventlet yielding.
|
||||
Use nova.utils.cooperative_yield() instead.
|
||||
- [N375] Don't mock threading.Event directly, target the mock to your
|
||||
specific Event instance.
|
||||
|
||||
Creating Unit Tests
|
||||
-------------------
|
||||
|
||||
Reference in New Issue
Block a user