Skip to content

Commit

Permalink
fix wasm timestamp test by adding 10M tolerance (#74317)
Browse files Browse the repository at this point in the history
* fix wasm timestamp

* doh
  • Loading branch information
danmoseley authored Aug 22, 2022
1 parent 0588129 commit 12b4415
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,12 @@ public void CopyToNanosecondsPresent_LowTempRes()
output.Directory.Create();
output = input.CopyTo(output.FullName, true);

Assert.Equal(input.LastWriteTime.Ticks, output.LastWriteTime.Ticks);
// On Browser, we sometimes see a difference of exactly 10M, eg.,
// Expected: 637949564520000000
// Actual: 637949564530000000
double tolerance = PlatformDetection.IsBrowser ? 10_000_000 : 0;

Assert.Equal(input.LastWriteTime.Ticks, output.LastWriteTime.Ticks, tolerance);
Assert.False(HasNonZeroNanoseconds(output.LastWriteTime));
}

Expand Down

0 comments on commit 12b4415

Please sign in to comment.