[CalendarServer-changes] [12467] CalendarServer/branches/users/cdaboo/scheduling-queue-refresh
source_changes at macosforge.org
source_changes at macosforge.org
Wed Mar 12 11:20:53 PDT 2014
Revision: 12467
http://trac.calendarserver.org//changeset/12467
Author: cdaboo at apple.com
Date: 2014-01-28 11:56:12 -0800 (Tue, 28 Jan 2014)
Log Message:
-----------
Checkpoint: change scheduling queue config default to enabled, but have regular tests disable it.
Modified Paths:
--------------
CalendarServer/branches/users/cdaboo/scheduling-queue-refresh/twistedcaldav/stdconfig.py
CalendarServer/branches/users/cdaboo/scheduling-queue-refresh/twistedcaldav/test/util.py
CalendarServer/branches/users/cdaboo/scheduling-queue-refresh/txdav/common/datastore/test/util.py
Modified: CalendarServer/branches/users/cdaboo/scheduling-queue-refresh/twistedcaldav/stdconfig.py
===================================================================
--- CalendarServer/branches/users/cdaboo/scheduling-queue-refresh/twistedcaldav/stdconfig.py 2014-01-28 19:17:10 UTC (rev 12466)
+++ CalendarServer/branches/users/cdaboo/scheduling-queue-refresh/twistedcaldav/stdconfig.py 2014-01-28 19:56:12 UTC (rev 12467)
@@ -761,7 +761,7 @@
},
"WorkQueues" : {
- "Enabled" : False, # Work queues for scheduling enabled
+ "Enabled" : True, # Work queues for scheduling enabled
"RequestDelaySeconds" : 5, # Number of seconds delay for a queued scheduling request/cancel
"ReplyDelaySeconds" : 1, # Number of seconds delay for a queued scheduling reply
"AutoReplyDelaySeconds" : 5, # Time delay for sending an auto reply iTIP message
Modified: CalendarServer/branches/users/cdaboo/scheduling-queue-refresh/twistedcaldav/test/util.py
===================================================================
--- CalendarServer/branches/users/cdaboo/scheduling-queue-refresh/twistedcaldav/test/util.py 2014-01-28 19:17:10 UTC (rev 12466)
+++ CalendarServer/branches/users/cdaboo/scheduling-queue-refresh/twistedcaldav/test/util.py 2014-01-28 19:56:12 UTC (rev 12467)
@@ -231,6 +231,7 @@
os.mkdir(self.serverRoot)
config.reset()
+ self.configInit()
config.ServerRoot = os.path.abspath(self.serverRoot)
config.ConfigRoot = "config"
Modified: CalendarServer/branches/users/cdaboo/scheduling-queue-refresh/txdav/common/datastore/test/util.py
===================================================================
--- CalendarServer/branches/users/cdaboo/scheduling-queue-refresh/txdav/common/datastore/test/util.py 2014-01-28 19:17:10 UTC (rev 12466)
+++ CalendarServer/branches/users/cdaboo/scheduling-queue-refresh/txdav/common/datastore/test/util.py 2014-01-28 19:56:12 UTC (rev 12467)
@@ -38,7 +38,7 @@
from twext.python.log import Logger
from twext.python.filepath import CachingFilePath
-from twistedcaldav.ical import Component as VComponent
+from twistedcaldav.ical import Component as VComponent, Component
from twext.enterprise.adbapi2 import ConnectionPool
from twext.enterprise.ienterprise import AlreadyFinishedError
from txweb2.dav.resource import TwistedGETContentMD5
@@ -529,7 +529,35 @@
return data % {"now": nowYear}
+dateSubstitutions = {}
+
+def componentUpdate(data):
+ """
+ Update the supplied iCalendar data so that all dates are updated to the current year.
+ """
+
+ if len(dateSubstitutions) == 0:
+ now = DateTime.getToday()
+
+ dateSubstitutions["now"] = now
+
+ for i in range(30):
+ attrname = "now_back%s" % (i + 1,)
+ setattr(self, attrname, now.duplicate())
+ getattr(self, attrname).offsetDay(-(i + 1))
+ dateSubstitutions[attrname] = getattr(self, attrname)
+
+ for i in range(30):
+ attrname = "now_fwd%s" % (i + 1,)
+ setattr(self, attrname, now.duplicate())
+ getattr(self, attrname).offsetDay(i + 1)
+ dateSubstitutions[attrname] = getattr(self, attrname)
+
+ return Component.fromString(data.format(dateSubstitutions))
+
+
+
@inlineCallbacks
def resetCalendarMD5s(md5s, store):
"""
@@ -713,8 +741,21 @@
def setUp(self):
self.counter = 0
self.notifierFactory = StubNotifierFactory()
+ self.configInit()
+ def configInit(self):
+ """
+ Hard code some config options
+ """
+
+ # Work queues for implicit scheduling slow down tests a lot and require them all to add
+ # "waits" for work to complete. Rewriting all the current tests to do that is not practical
+ # right now, so we will turn this off by default. Instead we will have a set of tests dedicated
+ # to work queue-based scheduling which will patch this option to True.
+ config.Scheduling.Options.WorkQueues.Enabled = False
+
+
def storeUnderTest(self):
"""
Subclasses must implement this method.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140312/e4d49a7a/attachment.html>
More information about the calendarserver-changes
mailing list