cron4s icon indicating copy to clipboard operation
cron4s copied to clipboard

cron4s.lib.js.JSDateSpec is flaky

Open fthomas opened this issue 3 years ago • 1 comments

JSDateSpec sometimes fails:

  • https://github.com/alonsodomin/cron4s/pull/410#issuecomment-931430083
  • https://github.com/alonsodomin/cron4s/pull/417#issuecomment-931938816

It looks like tests fail for dates where the day is the 31 and the month is set to a month that has less than 31 days.

fthomas avatar Oct 01 '21 11:10 fthomas

It seems invalid dates(e.g. 09/31,11/31) are created by property testing. Why does this happen only on JS platform?

IsDateTime[JSDate, Month].dateTime.immutability *** FAILED ***
[info]   InvalidFieldValue was thrown during property evaluation.
[info]     Message: Value 9 is not valid for field Month
[info]     Occurred when passed generated values (
[info]       arg0 = Tue May 31 2016 01:58:54 GMT+0000 (Coordinated Universal Time),
[info]       arg1 = CronFieldValue(Month,9)
[info]     )
IsDateTime[JSDate, Month].dateTime.settable *** FAILED ***
[info]   InvalidFieldValue was thrown during property evaluation.
[info]     Message: Value 11 is not valid for field Month
[info]     Occurred when passed generated values (
[info]       arg0 = Wed Jul 31 1991 10:09:59 GMT+0000 (Coordinated Universal Time),
[info]       arg1 = CronFieldValue(Month,11)
[info]     )
[info]   Init Seed: -3201136346395326777

i10416 avatar Jun 03 '23 11:06 i10416