Bug 442821

Summary: TimelineModelTest::testWeatherElements fails at 23:00
Product: [Applications] KDE Itinerary Reporter: Bernhard M. Wiedemann <kdebugsbmw>
Component: generalAssignee: Volker Krause <vkrause>
Status: RESOLVED FIXED    
Severity: normal CC: fabian
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 21.08.2
Sentry Crash Report:

Description Bernhard M. Wiedemann 2021-09-23 03:38:37 UTC
SUMMARY timelinemodeltest.cpp fails reproducibly 4% of the time


STEPS TO REPRODUCE
1. run itinerary-21.08.1 tests with the system clock set between 23:00 and 23:59 UTC (in case it matters: we use TZ=UTC)
   on openSUSE, you can do that with osc co openSUSE:Factory/itinerary && cd $_ && osc build --vm-type=kvm --noservice --clean --build-opt=--vm-custom-opt="-rtc base=2021-11-01T23:29:00" standard


OBSERVED RESULT
QDEBUG : TimelineModelTest::testWeatherElements() weather recomputation done^M
FAIL!  : TimelineModelTest::testWeatherElements() Compared values are not the sa
me^M
   Actual   (fc.dateTime().date()): 2021/09/05^M
   Expected (QDate::currentDate()): 2021/09/04^M
   Loc: [/home/abuild/rpmbuild/BUILD/itinerary-21.08.1/autotests/timelinemodelte
st.cpp(284)]^M
QWARN  : TimelineModelTest::testMultiTraveller() Comparators already registered
for type KItinerary::BusTrip^M


EXPECTED RESULT
tests should not fail like this

SOFTWARE/OS VERSIONS

Linux/KDE Plasma: openSUSE Tumbleweed 20210916
KDE Plasma Version: ?
KDE Frameworks Version: 5.86
Qt Version: 5.15.2

ADDITIONAL INFORMATION

This bug was found while working on reproducible builds for openSUSE.
Comment 1 Volker Krause 2021-09-23 15:58:12 UTC
Git commit 4f0258094fd16fae1c7c680b5a48d4bb2696733a by Volker Krause.
Committed on 23/09/2021 at 15:55.
Pushed by vkrause into branch 'release/21.08'.

Fix timeline model test breaking during the last hour of the day

If there's only <1h left, we wont get a weather element for the ongoing day
anymore, so start the test from the next day in that case.
FIXED-IN: 21.08.2

M  +21   -15   autotests/timelinemodeltest.cpp

https://invent.kde.org/pim/itinerary/commit/4f0258094fd16fae1c7c680b5a48d4bb2696733a