Skip to content

Commit

Permalink
Added a timeout argument to the ZEO4 server (copy)
Browse files Browse the repository at this point in the history
It turns out the ZEO4 server doesn't shutdown cleanly in tests without
a shorter timeout (like the one I added for ZEO5).

For now, this is just in the copy used in the ZEO5 tests.  If I have
to updatre the copy at some point (hopefully not), then I'll add this
to ZEO4 proper.
  • Loading branch information
Jim Fulton committed Aug 3, 2016
1 parent 7cb6005 commit 9d765e8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/ZEO/tests/ZEO4/StorageServer.py
Expand Up @@ -1153,9 +1153,9 @@ def get_invalidations(self, storage_id, tid):

return latest_tid, list(oids)

def loop(self):
def loop(self, timeout=30):
try:
asyncore.loop(map=self.socket_map)
asyncore.loop(timeout, map=self.socket_map)
except Exception:
if not self.__closed:
raise # Unexpected exc
Expand Down
3 changes: 1 addition & 2 deletions src/ZEO/tests/forker.py
Expand Up @@ -134,8 +134,7 @@ def runner(config, qin, qout, timeout=None,
qout.put(server.server.acceptor.addr)
logger.debug('ADDRESS SENT')
thread = threading.Thread(
target=server.server.loop,
kwargs={} if ZEO4_SERVER else dict(timeout=.2),
target=server.server.loop, kwargs=dict(timeout=.2),
name = None if name is None else name + '-server',
)
thread.setDaemon(True)
Expand Down

0 comments on commit 9d765e8

Please sign in to comment.