Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Revolution1 committed Apr 16, 2019
1 parent aacc120 commit dc8ad3f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions etcd3/aio_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion etcd3/stateful/watch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
5 changes: 3 additions & 2 deletions tests/test_watch_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

0 comments on commit dc8ad3f

Please sign in to comment.