Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The test case was failing if the test was run at some particular time of the day. For ex: If the test was triggered @0:15:0, the last scheduled time will be 23:15:0 of the previous day since we are setting it to an hour earlier than the current time. Now when we calculate the getNextSchedule, the next schedule will point to the current day, when the cron job is scheduled to run at midnight every day. So in this case, the lastMissed will be pointing to a valid time. This leads to some test cases to get unexpected value for the lastMissed time which expects it to be time.Time{}. Though we get the expected wantErr in such cases too, since we are comparing the other return values seperately. To avoid such failures, this patch checks for multiple expected last scheduled times. Also the last scheduled time is aligned with the cron job schedule to keep it relative. Signed-off-by: karthik-us <[email protected]>
- Loading branch information