436
438
> client_timeout_count)
439
class CatastrophicClientLoopFailure(
440
ZEO.tests.ConnectionTests.CommonSetupTearDown):
441
"""Test what happens when the client loop falls over
441
class ZRPCConnectionTests(ZEO.tests.ConnectionTests.CommonSetupTearDown):
444
443
def getConfig(self, path, create, read_only):
445
444
return """<mappingstorage 1/>"""
447
446
def checkCatastrophicClientLoopFailure(self):
447
# Test what happens when the client loop falls over
448
448
self._storage = self.openClientStorage()
472
472
self.assertEqual(log[1][0], "Couldn't close a dispatcher.")
473
473
self.assert_('exc_info' in log[1][1])
475
class ConnectionInvalidationOnReconnect(
476
ZEO.tests.ConnectionTests.CommonSetupTearDown):
477
"""Test what happens when the client loop falls over
475
def checkExceptionLogsAtError(self):
476
# Test the exceptions are logged at error
477
self._storage = self.openClientStorage()
478
conn = self._storage._connection
482
lambda l, m, *a, **kw: log.append((l,m % a, kw))
480
def getConfig(self, path, create, read_only):
481
return """<mappingstorage 1/>"""
485
# This is a deliberately bogus call to get an exception
487
self._storage._connection.handle_request('foo',0,'history',(1,2,3,4))
489
level,message,kw = log[1]
490
self.assertEqual(level,logging.ERROR)
491
self.failUnless(message.endswith(
492
') history() raised exception: history() takes at'
493
' most 3 arguments (5 given)'
495
self.assertEqual(kw,{'exc_info':True})
483
500
def checkConnectionInvalidationOnReconnect(self):
1215
1232
quick_test_classes = [
1216
1233
FileStorageRecoveryTests, ConfigurationTests, HeartbeatTests,
1217
CatastrophicClientLoopFailure, ConnectionInvalidationOnReconnect,
1234
ZRPCConnectionTests,
1220
1237
class ServerManagingClientStorage(ClientStorage):