[1] There are some trivial conflicts when merging this into trunk: conflicts: Text conflict in storm/databases/postgres.py Text conflict in tests/databases/postgres.py [2] tests/databases/proxy.py is missing a copyright header. [3] +import threading + +TIMEOUT = 0.1 Please add an extra blank line before TIMEOUT to follow PEP-8 conventions. [4] + SocketServer.BaseRequestHandler.__init__( + self, request, client_address, server) Is there a reason not to use super(...) here? [5] + self.request.shutdown(socket.SHUT_WR) + +class ProxyTCPServer(SocketServer.ThreadingTCPServer): Please use two blank lines between class definitions to follow PEP-8 conventions. [6] Please replace single-quotes with double-quotes to follow existing conventions in the code. [7] + """Check whether the given exception value represents a + database disconnection. Please condense this comments to a single line or start it on a new line below the opening """ to match PEP-8 and existing conventions. [8] from storm.uri import URI is missing in tests/database/postgres.py. This causes PostgresDisconnectionTest.create_database_and_proxy to break. [9] I get the following errors when running the tests. The tests in trunk pass with the same PostgreSQL database, so I'm assuming the problem is related to changes in this branch. I haven't looked too closely, but it looks like this is related to the changes you made to the way Connection is created. $ trial tests.databases.postgres.PostgresDisconnectionTest /home/jkakar/src/universe/zope3/3.4.0a1/src/zope/interface/interface.py:206: RuntimeWarning: Python C API version mismatch for module _zope_interface_coptimizations: This Python has API version 1013, module _zope_interface_coptimizations has version 1012. import _zope_interface_coptimizations Running 6 tests. tests.databases.postgres PostgresDisconnectionTest test_catch_disconnect_on_commit ... [ERROR] test_catch_disconnect_on_execute ... ---------------------------------------- Exception happened during processing of request from ('127.0.0.1', 36799) Traceback (most recent call last): File "SocketServer.py", line 464, in process_request_thread self.finish_request(request, client_address) File "SocketServer.py", line 254, in finish_request self.RequestHandlerClass(request, client_address, self) File "/home/jkakar/src/canonical/storm/review/tests/databases/proxy.py", line 17, in __init__ self, request, client_address, server) File "SocketServer.py", line 522, in __init__ self.handle() File "/home/jkakar/src/canonical/storm/review/tests/databases/proxy.py", line 41, in handle self.request.send(chunk) error: (32, 'Broken pipe') ---------------------------------------- [ERROR] test_catch_disconnect_on_reconnect ... ---------------------------------------- Exception happened during processing of request from ('127.0.0.1', 33746) Traceback (most recent call last): File "SocketServer.py", line 464, in process_request_thread self.finish_request(request, client_address) File "SocketServer.py", line 254, in finish_request self.RequestHandlerClass(request, client_address, self) File "/home/jkakar/src/canonical/storm/review/tests/databases/proxy.py", line 17, in __init__ self, request, client_address, server) File "SocketServer.py", line 522, in __init__ self.handle() File "/home/jkakar/src/canonical/storm/review/tests/databases/proxy.py", line 41, in handle self.request.send(chunk) error: (32, 'Broken pipe') ---------------------------------------- [ERROR] test_connection_stays_disconnected_in_transaction ... ---------------------------------------- Exception happened during processing of request from ('127.0.0.1', 45983) Traceback (most recent call last): File "SocketServer.py", line 464, in process_request_thread self.finish_request(request, client_address) File "SocketServer.py", line 254, in finish_request self.RequestHandlerClass(request, client_address, self) File "/home/jkakar/src/canonical/storm/review/tests/databases/proxy.py", line 17, in __init__ self, request, client_address, server) File "SocketServer.py", line 522, in __init__ self.handle() File "/home/jkakar/src/canonical/storm/review/tests/databases/proxy.py", line 41, in handle self.request.send(chunk) error: (32, 'Broken pipe') ---------------------------------------- [ERROR] test_proxy_works ... ---------------------------------------- Exception happened during processing of request from ('127.0.0.1', 43526) Traceback (most recent call last): File "SocketServer.py", line 464, in process_request_thread self.finish_request(request, client_address) File "SocketServer.py", line 254, in finish_request self.RequestHandlerClass(request, client_address, self) File "/home/jkakar/src/canonical/storm/review/tests/databases/proxy.py", line 17, in __init__ self, request, client_address, server) File "SocketServer.py", line 522, in __init__ self.handle() File "/home/jkakar/src/canonical/storm/review/tests/databases/proxy.py", line 41, in handle self.request.send(chunk) error: (32, 'Broken pipe') ---------------------------------------- [ERROR] test_reconnect_after_rollback ... ---------------------------------------- Exception happened during processing of request from ('127.0.0.1', 58555) Traceback (most recent call last): File "SocketServer.py", line 464, in process_request_thread self.finish_request(request, client_address) File "SocketServer.py", line 254, in finish_request self.RequestHandlerClass(request, client_address, self) File "/home/jkakar/src/canonical/storm/review/tests/databases/proxy.py", line 17, in __init__ self, request, client_address, server) File "SocketServer.py", line 522, in __init__ self.handle() File "/home/jkakar/src/canonical/storm/review/tests/databases/proxy.py", line 41, in handle self.request.send(chunk) error: (32, 'Broken pipe') ---------------------------------------- [ERROR] =============================================================================== [ERROR]: tests.databases.postgres.PostgresDisconnectionTest.test_catch_disconnect_on_commit ---------------------------------------- Exception happened during processing of request from ('127.0.0.1', 51123) Traceback (most recent call last): File "SocketServer.py", line 464, in process_request_thread self.finish_request(request, client_address) File "SocketServer.py", line 254, in finish_request self.RequestHandlerClass(request, client_address, self) File "/home/jkakar/src/canonical/storm/review/tests/databases/proxy.py", line 17, in __init__ self, request, client_address, server) File "SocketServer.py", line 522, in __init__ self.handle() File "/home/jkakar/src/canonical/storm/review/tests/databases/proxy.py", line 41, in handle self.request.send(chunk) error: (32, 'Broken pipe') ---------------------------------------- Traceback (most recent call last): File "unittest.py", line 251, in run self.setUp() File "/home/jkakar/src/canonical/storm/review/tests/databases/base.py", line 405, in setUp self.create_connection() File "/home/jkakar/src/canonical/storm/review/tests/databases/base.py", line 421, in create_connection self.connection = self.database.connect() File "/home/jkakar/src/canonical/storm/review/storm/databases/postgres.py", line 216, in connect raw_connection = psycopg2.connect(self._dsn) psycopg2.OperationalError: fe_sendauth: no password supplied =============================================================================== [ERROR]: tests.databases.postgres.PostgresDisconnectionTest.test_catch_disconnect_on_execute Traceback (most recent call last): File "unittest.py", line 251, in run self.setUp() File "/home/jkakar/src/canonical/storm/review/tests/databases/base.py", line 405, in setUp self.create_connection() File "/home/jkakar/src/canonical/storm/review/tests/databases/base.py", line 421, in create_connection self.connection = self.database.connect() File "/home/jkakar/src/canonical/storm/review/storm/databases/postgres.py", line 216, in connect raw_connection = psycopg2.connect(self._dsn) psycopg2.OperationalError: fe_sendauth: no password supplied =============================================================================== [ERROR]: tests.databases.postgres.PostgresDisconnectionTest.test_catch_disconnect_on_reconnect Traceback (most recent call last): File "unittest.py", line 251, in run self.setUp() File "/home/jkakar/src/canonical/storm/review/tests/databases/base.py", line 405, in setUp self.create_connection() File "/home/jkakar/src/canonical/storm/review/tests/databases/base.py", line 421, in create_connection self.connection = self.database.connect() File "/home/jkakar/src/canonical/storm/review/storm/databases/postgres.py", line 216, in connect raw_connection = psycopg2.connect(self._dsn) psycopg2.OperationalError: fe_sendauth: no password supplied =============================================================================== [ERROR]: tests.databases.postgres.PostgresDisconnectionTest.test_connection_stays_disconnected_in_transaction Traceback (most recent call last): File "unittest.py", line 251, in run self.setUp() File "/home/jkakar/src/canonical/storm/review/tests/databases/base.py", line 405, in setUp self.create_connection() File "/home/jkakar/src/canonical/storm/review/tests/databases/base.py", line 421, in create_connection self.connection = self.database.connect() File "/home/jkakar/src/canonical/storm/review/storm/databases/postgres.py", line 216, in connect raw_connection = psycopg2.connect(self._dsn) psycopg2.OperationalError: fe_sendauth: no password supplied =============================================================================== [ERROR]: tests.databases.postgres.PostgresDisconnectionTest.test_proxy_works Traceback (most recent call last): File "unittest.py", line 251, in run self.setUp() File "/home/jkakar/src/canonical/storm/review/tests/databases/base.py", line 405, in setUp self.create_connection() File "/home/jkakar/src/canonical/storm/review/tests/databases/base.py", line 421, in create_connection self.connection = self.database.connect() File "/home/jkakar/src/canonical/storm/review/storm/databases/postgres.py", line 216, in connect raw_connection = psycopg2.connect(self._dsn) psycopg2.OperationalError: fe_sendauth: no password supplied =============================================================================== [ERROR]: tests.databases.postgres.PostgresDisconnectionTest.test_reconnect_after_rollback Traceback (most recent call last): File "unittest.py", line 251, in run self.setUp() File "/home/jkakar/src/canonical/storm/review/tests/databases/base.py", line 405, in setUp self.create_connection() File "/home/jkakar/src/canonical/storm/review/tests/databases/base.py", line 421, in create_connection self.connection = self.database.connect() File "/home/jkakar/src/canonical/storm/review/storm/databases/postgres.py", line 216, in connect raw_connection = psycopg2.connect(self._dsn) psycopg2.OperationalError: fe_sendauth: no password supplied ------------------------------------------------------------------------------- Ran 6 tests in 0.560s FAILED (errors=6) [10] All the tests in tests.databases.postgres.PostgresTest are failing with: Traceback (most recent call last): File "unittest.py", line 251, in run self.setUp() File "/home/jkakar/src/canonical/storm/review/tests/databases/base.py", line 49, in setUp self.create_tables() File "/home/jkakar/src/canonical/storm/review/tests/databases/postgres.py", line 46, in create_tables self.connection.execute("CREATE TABLE number " exceptions.AttributeError: 'psycopg2._psycopg.connection' object has no attribute 'execute' [11] I can't tell if it's a problem because the tests aren't running properly here, but it looks like PostgresDisconnectionTest should override and implement drop_database. [12] The comments in DatabaseDisconnectionTest that describe what each of the tests verifies should be docstrings. [13] The following tests should be named using the test_wb_ prefix because they're whitebox tests: test_ensure_connected_noop test_ensure_connected_dead_connection test_ensure_connected_reconnects test_ensure_connected_connect_failure test_check_disconnection test_rollback_clears_dead_connection Also, the comments that describe what each of these tests verifies should be docstrings.