diff --git a/etcd3/aio_client.py b/etcd3/aio_client.py index f7c7424..2e2c558 100644 --- a/etcd3/aio_client.py +++ b/etcd3/aio_client.py @@ -80,7 +80,7 @@ async def __aenter__(self): async def __aexit__(self, exc_type, exc_val, exc_tb): self.close() - async def __aiter__(self): + def __aiter__(self): return self async def __anext__(self): @@ -118,7 +118,7 @@ def __init__(self, resp): self.left_chunk = b'' self.i = 0 - async def __aiter__(self): + def __aiter__(self): return self async def next(self): diff --git a/etcd3/stateful/watch.py b/etcd3/stateful/watch.py index 3441891..e34b33b 100644 --- a/etcd3/stateful/watch.py +++ b/etcd3/stateful/watch.py @@ -392,4 +392,4 @@ def __iter__(self): # self.watching = False # no need the stop() always called in a with context self.stop() raise - time.sleep(0.3) + time.sleep(0.2) diff --git a/tests/test_watch_util.py b/tests/test_watch_util.py index a697b29..9103d93 100644 --- a/tests/test_watch_util.py +++ b/tests/test_watch_util.py @@ -126,7 +126,7 @@ def test_watcher_retry(client): w.runDaemon() times = MAX_RETRIES + 1 while times: - time.sleep(0.2) + time.sleep(0.5) if not w._resp.raw.closed: # directly close the tcp connection s = socket.fromfd(w._resp.raw._fp.fileno(), socket.AF_INET, socket.SOCK_STREAM) s.shutdown(socket.SHUT_RDWR) @@ -184,6 +184,7 @@ def test_watcher_rewatch_on_compaction(client): for i in range(10): # these event will be compacted etcdctl('put foo %s' % i) etcdctl('put foo bare') # will receive this event when re-watch - etcdctl("compaction --physical %s" % client.hash().header.revision) + client.compact(client.hash().header.revision, True) + # etcdctl("compaction --physical %s" % client.hash().header.revision) times -= 1 w._kill_response_stream() # trigger a re-watch