ajvb / kala

Modern Job Scheduler
MIT License
2.13k stars 187 forks source link

Fix stat for NextRunAt time (#146) #159

Closed rjsab closed 6 years ago

rjsab commented 6 years ago

Fix #146 to have NextRunAt report the earliest time instead of latest.

ajvb commented 6 years ago

@rjsabatini Would you mind including a regression test along side this change?

rjsab commented 6 years ago

@ajvb I'm extremely new to Go, and particularly testing in go. I've been doing some research and could use a bit of guidance. Would this be a another assert in the stats_test.go, or a new test function?

rjsab commented 6 years ago

@ajvb I made an attempt at the regression test. Let me know if isn't what you were expecting, and I'll be happy to make another attempt.

ajvb commented 6 years ago

@rjsabatini This is really close! What I'd suggest is making a job with a much shorter schedule (can use GetMockJobWithSchedule) and make sure that it's NextRunAt time is the same as what is returned by NewKalaStats. Does that make sense?