[CalendarServer-changes] [14329] CalendarServer/trunk

source_changes at macosforge.org source_changes at macosforge.org
Tue Jan 20 10:52:35 PST 2015


Revision: 14329
          http://trac.calendarserver.org//changeset/14329
Author:   sagen at apple.com
Date:     2015-01-20 10:52:35 -0800 (Tue, 20 Jan 2015)
Log Message:
-----------
Fix tests to not depend on worker pool

Modified Paths:
--------------
    CalendarServer/trunk/calendarserver/tap/test/test_caldav.py
    CalendarServer/trunk/txdav/common/datastore/test/util.py

Modified: CalendarServer/trunk/calendarserver/tap/test/test_caldav.py
===================================================================
--- CalendarServer/trunk/calendarserver/tap/test/test_caldav.py	2015-01-20 01:45:36 UTC (rev 14328)
+++ CalendarServer/trunk/calendarserver/tap/test/test_caldav.py	2015-01-20 18:52:35 UTC (rev 14329)
@@ -35,8 +35,8 @@
 from twisted.internet.defer import Deferred, inlineCallbacks, succeed
 from twisted.internet.task import Clock
 from twisted.internet import reactor
-from twisted.application.service import (IService, IServiceCollection,
-                                         MultiService)
+from twisted.application.service import (IService, IServiceCollection
+                                         )
 from twisted.application import internet
 
 from twext.python.log import Logger
@@ -63,7 +63,6 @@
     DataStoreMonitor
 )
 from calendarserver.provision.root import RootResource
-from twext.enterprise.jobqueue import PeerConnectionPool, LocalQueuer
 from StringIO import StringIO
 
 log = Logger()
@@ -463,66 +462,6 @@
 
 
 
-class StoreQueuerSetInMasterTests(CalDAVServiceMakerTestBase):
-
-    def configure(self):
-        super(StoreQueuerSetInMasterTests, self).configure()
-        config.ProcessType = "Combined"
-
-
-    def test_storeQueuerSetInMaster(self):
-        """
-        In the master, the store's queuer should be set to a
-        L{PeerConnectionPool}, so that work can be distributed to other
-        processes.
-        """
-        class NotAStore(object):
-            queuer = LocalQueuer(None)
-
-            def __init__(self, directory):
-                self.directory = directory
-
-            def newTransaction(self):
-                return None
-
-            def callWithNewTransactions(self, x):
-                pass
-
-            def directoryService(self):
-                return self.directory
-
-        store = NotAStore(self.directory)
-
-
-        def something(proposal):
-            pass
-
-        store.queuer.callWithNewProposals(something)
-
-
-        def patch(maker):
-            def storageServiceStandIn(createMainService, logObserver,
-                                      uid=None, gid=None, directory=None):
-                pool = None
-                logObserver = None
-                storageService = None
-                svc = createMainService(
-                    pool, store, logObserver, storageService
-                )
-                multi = MultiService()
-                svc.setServiceParent(multi)
-                return multi
-            self.patch(maker, "storageService", storageServiceStandIn)
-            return maker
-
-        maker = CalDAVServiceMaker()
-        maker = patch(maker)
-        maker.makeService(self.options)
-        self.assertIsInstance(store.queuer, PeerConnectionPool)
-        self.assertIn(something, store.queuer.proposalCallbacks)
-
-
-
 class SlaveServiceTests(CalDAVServiceMakerTestBase):
     """
     Test various configurations of the Slave service

Modified: CalendarServer/trunk/txdav/common/datastore/test/util.py
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/test/util.py	2015-01-20 01:45:36 UTC (rev 14328)
+++ CalendarServer/trunk/txdav/common/datastore/test/util.py	2015-01-20 18:52:35 UTC (rev 14329)
@@ -255,7 +255,7 @@
         # Start the job queue after store is up and cleaned
         if enableJobProcessing:
             pool = PeerConnectionPool(
-                reactor, store.newTransaction, None
+                reactor, store.newTransaction, None, useWorkerPool=False
             )
             store.queuer = store.queuer.transferProposalCallbacks(pool)
             pool.startService()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20150120/d5ac7d37/attachment.html>


More information about the calendarserver-changes mailing list