[eventlet-removal] rewrite wait_until_true function

there's no reason to use eventlet for basic 'wait for true' function,
all the tests are running syncronously one by one anyway
(in separate worker processes at most), and merely importing eventlet
can have some unexpected side-effects (for example [0]).

[0] https://storyboard.openstack.org/#!/story/2010902

Change-Id: I9178d9acc8d88e2ddb8fba1111f12a5d2681e33e
Signed-off-by: Pavlo Shchelokovskyy <shchelokovskyy@gmail.com>
diff --git a/neutron_tempest_plugin/common/utils.py b/neutron_tempest_plugin/common/utils.py
index 4ae374e..5d6a26a 100644
--- a/neutron_tempest_plugin/common/utils.py
+++ b/neutron_tempest_plugin/common/utils.py
@@ -25,7 +25,6 @@
 except ImportError:
     from urllib import parse as urlparse
 
-import eventlet
 from neutron_lib._i18n import _
 from oslo_log import log
 from tempest.lib import exceptions
@@ -79,15 +78,14 @@
     :param exception: Exception instance to raise on timeout. If None is passed
                       (default) then WaitTimeout exception is raised.
     """
-    try:
-        with eventlet.Timeout(timeout):
-            while not predicate():
-                eventlet.sleep(sleep)
-    except eventlet.Timeout:
-        if exception is not None:
-            # pylint: disable=raising-bad-type
-            raise exception
-        raise WaitTimeout(_("Timed out after %d seconds" % timeout))
+    start_time = time.time()
+    while not predicate():
+        elapsed_time = time.time() - start_time
+        if elapsed_time > timeout:
+            raise exception if exception else WaitTimeout(
+                _("Timed out after %d seconds") % timeout
+            )
+        time.sleep(sleep)
 
 
 def override_class(overriden_class, overrider_class):