Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Your now() in tests depends on current moment.

You cannot test how your code behaves when midnight passes, when daylight saving time changes either way, when it's 29th of February, etc.

More importantly, you cannot reliably (let alone quickly) test how your retry and timeout handling works, especially if two threads interact, or when you do (stubbed or mocked) remote API calls. All these things are the daily bread when working with Google's services, and basically at any setup with multiple (micro)services.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: