I've plugged some debug print inside the test and got the timestamps for some particular run:
now = 1313772780, file = 1219168343

As far as I can tell this is happening because 3 years ago here (Moscow, Russia) we had summer time at GMT+3 and now it is at GMT+4. DST is not longer in use in Russia.
Because of that, mtime calculation is one hour off.
Not sure how this should be fixed. Maybe increase error margin from one second to one hour plus one second?