test_create_ical is flaky
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-caldav (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
We're seeing some flakyness with the `test_create_ical` test case on Ubuntu's heavily loaded autopkgtest infrastructure. It seems like there's a timing issue, where test data can be generated at different points in time and the test fails when the data is not generated in the same second, see below:
299s E AssertionError: b'BEG[45 chars]*
=> See "163454Z" vs "163455Z"
Notes:
There is also a deprecation warning when using python3.12, I don't know if that might have an impact:
```
299s /usr/lib/
299s EPOCH = datetime.
```
Full logs (https:/
```
294s I: pybuild base:305: cd /tmp/autopkgtes
298s =======
298s platform linux -- Python 3.12.1, pytest-7.4.4, pluggy-1.3.0
298s rootdir: /tmp/autopkgtes
298s collected 107 items
298s
298s tests/test_
298s sssssssssssssss
298s tests/test_
298s tests/test_cdav.py ...... [ 98%]
298s tests/test_utils.py . [ 99%]
299s tests/test_vcal.py F [100%]
299s
299s =======
299s _______
299s
299s self = <tests.
299s
299s def test_create_
299s def create_
299s return self.verifyICal
299s
299s ## First, a fully valid ical_fragment should go through as is
299s self.assertSame
299s
299s ## One may add stuff to a fully valid ical_fragment
299s self.assertSame
299s create_
299s )
299s
299s ## binary string or unicode string ... shouldn't matter
299s self.assertSame
299s create_
299s ev + "\nPRIORITY:3\n",
299s )
299s
299s ## The returned ical_fragment should always contain BEGIN:VCALENDAR and END:VCALENDAR
299s ical_fragment = ev.replace(
299s self.assertSame
299s
299s ## Create something with a dtstart and verify that we get it back in the ical
299s some_ical0 = create_
299s summary="gobledok",
299s dtstart=
299s duration=
299s )
299s some_ical1 = create_
299s summary=
299s dtstart=
299s duration=
299s )
299s assert re.search(
299s > self.assertSame
299s
299s tests/test_
299s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
299s tests/test_
299s self.assertEqua
299s E AssertionError: b'BEG[45 chars]163454Z\
299s =======
299s ../../.
299s /usr/lib/
299s EPOCH = datetime.
299s
299s -- Docs: https:/
299s =======
299s FAILED tests/test_
299s ============= 1 failed, 32 passed, 74 skipped, 1 warning in 4.28s ==============
299s E: pybuild pybuild:391: test: plugin distutils failed with: exit code=1: cd /tmp/autopkgtes
```
Forwarded upstream: https:/ /github. com/python- caldav/ caldav/ issues/ 380