Fix flaky ForegroundNotificationServiceTests.Test_Delay
This test has been changed twice, first time was using DateTime, second was using Stopwatch. From my testing, both have a slightly different opinion than to Environment.TickCount as to how long has passed by 1 - 3 milliseconds. Environment.TickCount on my box has a resolution of 15/16 milliseconds accuracy, but Stopwatch and DateTime both found that these same 15/16 milliseconds took between 14 -> 16 milliseconds. Instead of accounting for this, I just changed this test to use the same clock as the underlying service.
Showing
想要评论请 注册 或 登录