Skip to content

Commit

Permalink
[corlib] Bump allowed diff time in FileTest.LastWriteTimeSubMs
Browse files Browse the repository at this point in the history
I've seen it fail with this:

```
1) LastWriteTimeSubMs (MonoTests.System.IO.FileTest.LastWriteTimeSubMs)
     Iteration #22 failed, diff.TotalSeconds: 1.000023, untouched: 20:14:03:0000000, now: 20:14:04:0000230
  Expected: True
  But was:  False
```
  • Loading branch information
akoeplinger committed Apr 20, 2018
1 parent f9a7746 commit f93b967
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mcs/class/corlib/Test/System.IO/FileTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1279,7 +1279,7 @@ public void LastWriteTimeSubMs ()
var now = DateTime.UtcNow;
var diff = now - untouched;
// sanity check
Assert.IsTrue (diff.TotalSeconds >= 0 && diff.TotalSeconds < 1.0, $"Iteration #{i} failed, diff.TotalSeconds: {diff.TotalSeconds}, untouched: {untouched.ToString (fmt)}, now: {now.ToString (fmt)}");
Assert.IsTrue (diff.TotalSeconds >= 0 && diff.TotalSeconds < 2.0, $"Iteration #{i} failed, diff.TotalSeconds: {diff.TotalSeconds}, untouched: {untouched.ToString (fmt)}, now: {now.ToString (fmt)}");
File.SetLastWriteTimeUtc (path, now);
var touched = File.GetLastWriteTimeUtc (path);

Expand Down

0 comments on commit f93b967

Please sign in to comment.