Add a 2 hour offset to tests to avoid being a day short after the clocks change#243194
Add a 2 hour offset to tests to avoid being a day short after the clocks change#243194bpasero merged 2 commits intomicrosoft:mainfrom
Conversation
|
@bpasero - GitHub is showing |
Pull request was closed
|
Thanks! |
|
FYI this leads to a 2 hour window in which the test fails :) #243619 |
|
Ah, the For days ago it uses the time since the date, divided by 84600000 seconds. I had tested this with -22 hours to be sure there would be no issue around midnight. But yesterday and today are special cases which test against midnight. The above PR looks like a good solution to me. |
|
Yeah I just realized that |
Fixes #243192
After the clocks change, this time 5 days ago is only 4 days 23 hours ago, which evaluates to 4 days ago and the test fails.
This change adds a bit more margin for error, but instead testing this time (-2 hours) 5 days ago.