diff --git a/compute_hyperv/tests/unit/test_base.py b/compute_hyperv/tests/unit/test_base.py index d443709f..60150473 100644 --- a/compute_hyperv/tests/unit/test_base.py +++ b/compute_hyperv/tests/unit/test_base.py @@ -14,7 +14,9 @@ # License for the specific language governing permissions and limitations # under the License. +import eventlet.hubs as hubs import mock +import monotonic from os_win import utilsfactory from compute_hyperv.tests import test @@ -39,3 +41,11 @@ class HyperVBaseTestCase(test.NoDBTestCase): '.'.join([class_type.__module__, class_type.__name__]), mocked_class) patcher.start() + + +class MonotonicTestCase(test.NoDBTestCase): + def test_monotonic(self): + import nova # noqa + + hub = hubs.get_hub() + self.assertEqual(monotonic.monotonic, hub.clock) diff --git a/nova/__init__.py b/nova/__init__.py index 42067924..3edd78c2 100644 --- a/nova/__init__.py +++ b/nova/__init__.py @@ -13,3 +13,14 @@ # under the License. __import__('pkg_resources').declare_namespace(__name__) + +import os + +os.environ['EVENTLET_NO_GREENDNS'] = 'yes' + +# NOTE(rpodolyaka): import oslo_service first, so that it makes eventlet hub +# use a monotonic clock to avoid issues with drifts of system time (see +# LP 1510234 for details) +import oslo_service # noqa + +import eventlet # noqa