You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, this test cannot work as designed anymore. The idea is
have cron fire off on November 1st and 2nd at 1AM, 2020. The PST->PDT changeover happens, so there are two "1AMs"
it should fire off once on November 1st
it should fire off again on November 2nd
The problem is there's no way to force BasicTimeChecker to stop. It will try to find the earliest date that matches the cron expression in the future. Failing that, it will pick the newest date that matches.
So this test fails because BasicTimeChecker immediately picks the November 2nd execution date, skipping over November 1st. The test was updated March 10 of 2020, and it would have worked until November 1st at 1:01 AM.
You can dynamically sub in "this year", but the test will still fail after November 1st, 1:01AM.
Also the test doesn't actually test the two execution times since it doesn't advance the timer.
I'm not sure how to actually accomplish this check without forcing "current time" to be before November 1st. You can do that with Joda's DateTimeUtils, but the change is JVM wide. If the goal is to test BasicTimeChecker, maybe a method could be added to get the next time that matches the expression or period without attempting to find the first one after now. The while loop in calculateNextTime could use this new method.
The text was updated successfully, but these errors were encountered:
Hi, this test cannot work as designed anymore. The idea is
The problem is there's no way to force BasicTimeChecker to stop. It will try to find the earliest date that matches the cron expression in the future. Failing that, it will pick the newest date that matches.
So this test fails because BasicTimeChecker immediately picks the November 2nd execution date, skipping over November 1st. The test was updated March 10 of 2020, and it would have worked until November 1st at 1:01 AM.
You can dynamically sub in "this year", but the test will still fail after November 1st, 1:01AM.
Also the test doesn't actually test the two execution times since it doesn't advance the timer.
I'm not sure how to actually accomplish this check without forcing "current time" to be before November 1st. You can do that with Joda's DateTimeUtils, but the change is JVM wide. If the goal is to test BasicTimeChecker, maybe a method could be added to get the next time that matches the expression or period without attempting to find the first one after now. The while loop in
calculateNextTime
could use this new method.The text was updated successfully, but these errors were encountered: