[CalendarServer-changes] [7514] CalendarServer/trunk/contrib/performance/loadtest

source_changes at macosforge.org source_changes at macosforge.org
Fri May 20 13:27:42 PDT 2011


Revision: 7514
          http://trac.macosforge.org/projects/calendarserver/changeset/7514
Author:   exarkun at twistedmatrix.com
Date:     2011-05-20 13:27:41 -0700 (Fri, 20 May 2011)
Log Message:
-----------
start writing a test for the getetag KeyError issue, caused by an event being deleted between the calendar PROPFIND and the event REPORT in _updateCalendar

Modified Paths:
--------------
    CalendarServer/trunk/contrib/performance/loadtest/sim.py
    CalendarServer/trunk/contrib/performance/loadtest/test_ical.py

Modified: CalendarServer/trunk/contrib/performance/loadtest/sim.py
===================================================================
--- CalendarServer/trunk/contrib/performance/loadtest/sim.py	2011-05-20 18:12:53 UTC (rev 7513)
+++ CalendarServer/trunk/contrib/performance/loadtest/sim.py	2011-05-20 20:27:41 UTC (rev 7514)
@@ -227,6 +227,7 @@
             addObserver(obs.observe)
             self.reactor.addSystemEventTrigger(
                 'before', 'shutdown', removeObserver, obs.observe)
+        # XXX Screws with the tests, need to make this conditional or something.
         startLogging(stderr, setStdout=False)
         sim = self.createSimulator()
         arrivalPolicy = self.createArrivalPolicy()

Modified: CalendarServer/trunk/contrib/performance/loadtest/test_ical.py
===================================================================
--- CalendarServer/trunk/contrib/performance/loadtest/test_ical.py	2011-05-20 18:12:53 UTC (rev 7513)
+++ CalendarServer/trunk/contrib/performance/loadtest/test_ical.py	2011-05-20 20:27:41 UTC (rev 7514)
@@ -790,14 +790,30 @@
 </multistatus>
 """
 
-class SnowLeopardTests(TestCase):
+
+class SnowLeopardMixin:
     """
-    Tests for L{SnowLeopard}.
+    Mixin for L{TestCase}s for L{SnowLeopard}.
     """
     def setUp(self):
         self.client = SnowLeopard(None, "127.0.0.1", 80, None, None)
 
 
+    def interceptRequests(self):
+        requests = []
+        def request(*args):
+            result = Deferred()
+            requests.append((result, args))
+            return result
+        self.client._request = request
+        return requests
+
+
+
+class SnowLeopardTests(SnowLeopardMixin, TestCase):
+    """
+    Tests for L{SnowLeopard}.
+    """
     def test_parsePrincipalPROPFINDResponse(self):
         """
         L{Principal._parsePROPFINDResponse} accepts an XML document
@@ -871,16 +887,6 @@
         self.assertEquals(outbox.ctag, None)
 
 
-    def interceptRequests(self):
-        requests = []
-        def request(*args):
-            result = Deferred()
-            requests.append((result, args))
-            return result
-        self.client._request = request
-        return requests
-
-
     def test_changeEventAttendee(self):
         """
         SnowLeopard.changeEventAttendee removes one attendee from an
@@ -1003,3 +1009,18 @@
         self.assertEquals(
             first.singletonparams, second.singletonparams,
             "ContentLine singletonparams not equal")
+
+
+
+class UpdateCalendarTests(SnowLeopardMixin, TestCase):
+    """
+    Tests for L{SnowLeopard._updateCalendar}.
+    """
+    def test_eventMissing(self):
+        """
+        If an event included in the calendar PROPFIND response no longer exists
+        by the time a REPORT is issued for that event, the 404 is handled and
+        the rest of the normal update logic for that event is skipped.
+        """
+        d = self.client._updateCalendar('some calendar')
+        
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110520/7943cfc1/attachment-0001.html>


More information about the calendarserver-changes mailing list