[CalendarServer-changes] [14145] CalendarServer/trunk/calendarserver/tools/test/test_importer.py
source_changes at macosforge.org
source_changes at macosforge.org
Fri Nov 7 10:50:59 PST 2014
Revision: 14145
http://trac.calendarserver.org//changeset/14145
Author: sagen at apple.com
Date: 2014-11-07 10:50:59 -0800 (Fri, 07 Nov 2014)
Log Message:
-----------
Trying to speed up the work queue in the import test
Modified Paths:
--------------
CalendarServer/trunk/calendarserver/tools/test/test_importer.py
Modified: CalendarServer/trunk/calendarserver/tools/test/test_importer.py
===================================================================
--- CalendarServer/trunk/calendarserver/tools/test/test_importer.py 2014-11-07 18:11:21 UTC (rev 14144)
+++ CalendarServer/trunk/calendarserver/tools/test/test_importer.py 2014-11-07 18:50:59 UTC (rev 14145)
@@ -19,12 +19,14 @@
"""
from calendarserver.tools.importer import importCollectionComponent, ImportException
+from twext.enterprise.jobqueue import JobItem
+from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks
from twistedcaldav import customxml
from twistedcaldav.ical import Component
from twistedcaldav.test.util import StoreTestCase
+from txdav.base.propertystore.base import PropertyName
from txdav.xml import element as davxml
-from txdav.base.propertystore.base import PropertyName
DATA_MISSING_SOURCE = """BEGIN:VCALENDAR
@@ -148,6 +150,17 @@
Tests for importing data to a live store.
"""
+ def configure(self):
+ super(ImportTests, self).configure()
+ # Enable the queue and make it fast
+ self.patch(self.config.Scheduling.Options.WorkQueues, "Enabled", True)
+ self.patch(self.config.Scheduling.Options.WorkQueues, "RequestDelaySeconds", 0.1)
+ self.patch(self.config.Scheduling.Options.WorkQueues, "ReplyDelaySeconds", 0.1)
+ self.patch(self.config.Scheduling.Options.WorkQueues, "AutoReplyDelaySeconds", 0.1)
+ self.patch(self.config.Scheduling.Options.WorkQueues, "AttendeeRefreshBatchDelaySeconds", 0.1)
+ self.patch(self.config.Scheduling.Options.WorkQueues, "AttendeeRefreshBatchIntervalSeconds", 0.1)
+
+
@inlineCallbacks
def test_ImportComponentMissingSource(self):
@@ -221,6 +234,8 @@
component = Component.allFromString(DATA_WITH_ORGANIZER)
yield importCollectionComponent(self.store, component)
+ yield JobItem.waitEmpty(self.store.newTransaction, reactor, 60)
+
txn = self.store.newTransaction()
home = yield txn.calendarHomeWithUID("user01")
collection = yield home.childWithName("calendar")
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20141107/644cfece/attachment-0001.html>
More information about the calendarserver-changes
mailing list