Skip to content

Commit 12b4415

Browse files
authored
fix wasm timestamp test by adding 10M tolerance (#74317)
* fix wasm timestamp * doh
1 parent 0588129 commit 12b4415

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/libraries/System.IO.FileSystem/tests/FileInfo/GetSetTimes.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,12 @@ public void CopyToNanosecondsPresent_LowTempRes()
153153
output.Directory.Create();
154154
output = input.CopyTo(output.FullName, true);
155155

156-
Assert.Equal(input.LastWriteTime.Ticks, output.LastWriteTime.Ticks);
156+
// On Browser, we sometimes see a difference of exactly 10M, eg.,
157+
// Expected: 637949564520000000
158+
// Actual: 637949564530000000
159+
double tolerance = PlatformDetection.IsBrowser ? 10_000_000 : 0;
160+
161+
Assert.Equal(input.LastWriteTime.Ticks, output.LastWriteTime.Ticks, tolerance);
157162
Assert.False(HasNonZeroNanoseconds(output.LastWriteTime));
158163
}
159164

0 commit comments

Comments
 (0)