Closed tobixen closed 2 years ago
I managed to catch it through this test code. Test breaks with 3bdda2b424cc28afc0aeba5a934f7370073e63c5 but passes with a43ba24a13ac5a8810cc13b031fe73d6505e1e95.
def testXandikosCacheDateSearch(self):
# Create calendar, add event ...
c = self._fixCalendar()
e = c.save_event(ev1)
# .. and search for it.
r = c.search(comp_class=Event, start=datetime(2006, 7, 13, 17, 00, 00), end=datetime(2006, 7, 15, 17, 00, 00), expand=False)
assert e.instance.vevent.uid == r[0].instance.vevent.uid
assert len(r) == 1
r = c.search(comp_class=Event, start=datetime(2006, 7, 13, 17, 00, 00), end=datetime(2006, 7, 15, 17, 00, 00), expand=False)
r = c.search(comp_class=Event, start=datetime(2006, 7, 13, 17, 00, 00), end=datetime(2006, 7, 15, 17, 00, 00), expand=False)
r = c.search(comp_class=Event, start=datetime(2006, 7, 13, 17, 00, 00), end=datetime(2006, 7, 15, 17, 00, 00), expand=False)
r = c.search(comp_class=Event, start=datetime(2006, 7, 13, 17, 00, 00), end=datetime(2006, 7, 15, 17, 00, 00), expand=False)
r = c.search(comp_class=Event, start=datetime(2006, 7, 13, 17, 00, 00), end=datetime(2006, 7, 15, 17, 00, 00), expand=False)
r = c.search(comp_class=Event, start=datetime(2006, 7, 13, 17, 00, 00), end=datetime(2006, 7, 15, 17, 00, 00), expand=False)
r = c.search(comp_class=Event, start=datetime(2006, 7, 13, 17, 00, 00), end=datetime(2006, 7, 15, 17, 00, 00), expand=False)
r = c.search(comp_class=Event, start=datetime(2006, 7, 13, 17, 00, 00), end=datetime(2006, 7, 15, 17, 00, 00), expand=False)
assert e.instance.vevent.uid == r[0].instance.vevent.uid
assert len(r) == 1
For what it's worth, the test above also passes when using my fix 5f03c3c0fd8166ffc54a1ddf3ddc399a6c2067f8 :-)
(Next time I'll try to write tests directly in the xandikos project instead of in my project ... it would probably be more useful)
The attached PR should address this. You'll probably find more though, I haven't done an exhaustive check of all other property types.
Are you sure this caching regime is a sane idea at all? :p I'd say you need test code going through the serialization-deserialization logic for all the different value types, and also with parameters included. And having a different code path on the seventh execution do lead into baffling bugs that are hard to reproduce.
Here is another weird traceback:
This one, as the previous one, fails on my standalone server but passes when running the same tests towards an "embedded" server. I suppose that the difference is that the "embedded" server is taken up and down for each test, while the "standalone" server is receiving the tests in a series. I'm pretty sure that I will be able to write up test code again with repeated report queries and the seventh to fail ... but I don't know when I will have the time.
Here is the report query:
And the calendar contains one event: