Skip to content

Commit

Permalink
Use a timeout argument in a test to avoid waiting too long when demon…
Browse files Browse the repository at this point in the history
…strating ClientDisconnected errors
  • Loading branch information
Jim Fulton committed Jun 2, 2016
1 parent d50d982 commit da4d4ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/ZEO/ClientStorage.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,10 +476,12 @@ def _check_trans(self, trans, meth):

return buf

def history(self, oid, size=1):
def history(self, oid, size=1,
timeout=None, # for tests
):
"""Storage API: return a sequence of HistoryEntry objects.
"""
return self._call('history', oid, size)
return self._call('history', oid, size, timeout=timeout)

def record_iternext(self, next=None):
"""Storage API: get the next database record.
Expand Down
3 changes: 2 additions & 1 deletion src/ZEO/tests/ConnectionTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,8 @@ def checkReconnectUpgrade(self):
self.pollDown()

# Accesses should fail now
self.assertRaises(ClientDisconnected, self._storage.history, ZERO)
self.assertRaises(ClientDisconnected, self._storage.history, ZERO,
timeout=1)

# Restart the server, this time read-write
self.startServer(create=0, keep=0)
Expand Down

0 comments on commit da4d4ce

Please sign in to comment.