[CalendarServer-changes] [6875] CalendarServer/branches/users/glyph/db-reconnect/twext/enterprise/ test/test_adbapi2.py
source_changes at macosforge.org
source_changes at macosforge.org
Thu Feb 3 15:41:58 PST 2011
Revision: 6875
http://trac.macosforge.org/projects/calendarserver/changeset/6875
Author: glyph at apple.com
Date: 2011-02-03 15:41:57 -0800 (Thu, 03 Feb 2011)
Log Message:
-----------
test for final (I hope) relevant FIXME in the code
Modified Paths:
--------------
CalendarServer/branches/users/glyph/db-reconnect/twext/enterprise/test/test_adbapi2.py
Modified: CalendarServer/branches/users/glyph/db-reconnect/twext/enterprise/test/test_adbapi2.py
===================================================================
--- CalendarServer/branches/users/glyph/db-reconnect/twext/enterprise/test/test_adbapi2.py 2011-02-03 23:41:55 UTC (rev 6874)
+++ CalendarServer/branches/users/glyph/db-reconnect/twext/enterprise/test/test_adbapi2.py 2011-02-03 23:41:57 UTC (rev 6875)
@@ -639,4 +639,22 @@
self.assertEquals(stopResult, [None])
+ def test_tooManyConnectionsWhileOthersFinish(self):
+ """
+ L{ConnectionPool.connection} will not spawn more than the maximum
+ connections if there are finishing transactions outstanding.
+ """
+ a = self.pool.connection()
+ b = self.pool.connection()
+ self.pauseHolders()
+ a.abort()
+ b.abort()
+ # Remove the holders for the existing connections, so that the 'extra'
+ # connection() call wins the race and gets executed first.
+ self.holders[:] = []
+ self.pool.connection()
+ self.flushHolders()
+ self.assertEquals(len(self.factory.connections), 2)
+
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110203/f0689324/attachment-0001.html>
More information about the calendarserver-changes
mailing list