# Title: The test that fails in November Sometime around last spring we needed to implement time based scheduling for tasks at $JOB. As we were all seasoned cron veterans, we went with adding cron-like expression support to our orchestration/background processing engine. I implemented it, added some tests on top, my colleague tested it and everything was fine. Fast forward to November, one of the tests I added started failing with "ArgumentError (mon out of range)". The test was about testing monthly scheduling. What I did in that test was: 1) Store current time 2) Disassemble the time to years, months, days and so on 3) Make month = (month + 1) % 12 4) Increase year if months "overflowed" to another year 5) Assemble new datetime 6) Compare the time when next execution should occur with time constructed in 4) At that time, it seemed like a perfectly sensible thing to do. Now it shouldn't be hard to tell what went wrong. In November the "new month" was 0 and the Date class expected a number between 1 and 12. Sadly because the test started failing after almost half a year of reliable service, we first started to look for changes in the libraries we depended on. It took some time to realize, the only thing changed was time.