periodicity: fix infinite loop with impossible combinations of week and months
Some combinations of periodicity, for example repeat every first week of the year and every month February are impossible (because the first week of the year is always in January) and such configurations caused infinite loops or probably overflow if we wait long enough. The algorithm being to try the next day until all constraints are met, it is not guaranteed to terminate. To make sure the algorithm terminate, we rely on the fact that calendars repeat after some time, so if after a few years we did not find a matching combination, we can stop retrying. according to https://en.wikipedia.org/wiki/Determination_of_the_day_of_the_week > Each leap year repeats once every 28 years, and every common year > repeats once every 6 years and twice every 11 years. so trying for 28 years should be enough to see all combinations
Status | Job ID | Name | Coverage | ||||||
---|---|---|---|---|---|---|---|---|---|
External | |||||||||
passed |
#340111
external
|
ERP5.CodingStyleTest-Master |
00:42:20
|
||||||
passed |
#340113
external
|
ERP5.PerformanceTest-Master |
00:26:11
|
||||||
failed |
#340124
external
|
ERP5.UnitTest-Master |
01:03:06
|
||||||
failed |
#340114
external
|
ERP5.UnitTest-Master.Medusa |
01:18:02
|
||||||
passed |
#340099
external
|
SlapOS.Eggs.UnitTest-Master.Python2 |
00:11:15
|
||||||
passed |
#340086
external
|
SlapOS.Eggs.UnitTest-Master.Python3 |
00:11:54
|
||||||