Elektrine lite

← Feed

@betabug@mastodon.sdf.org

Post #1434211

2026-04-19 11:55 UTC

@jdm_ @servo Been there, fixed that kind of tests ... multiple times. Also the ones that break only when the end of the month falls on a Friday. Or when the tests are run within 30min before midnight on a Tuesday. Or when the current week spans two months and the tests that checks "something this week" and "something next week" find a different month. Etc. etc.

Replies (2)

  • @thomasfuchs@hachyderm.io 2026-04-19 13:32

    @betabug @jdm_ @servo Normally you fix this by setting the current date and time your code sees while the test is running, e.g. in Ruby there's https://github.com/travisjeffery/timecop to mock what system date/time looks like

    Open ##1434212

  • @dagi3d@ruby.social 2026-04-20 16:49

    @betabug @jdm_ @servo I remember being biten by one that failed when I traveled and changed the timezone (iirc timezone was defined in dev/prod but not for the test suites)

    Open ##1469532