Skip to content

Commit 7cb9424

Browse files
authored
[wasm] Work around System.Diagnostics.Tests.StopwatchTests.GetTimestamp failure (#62290)
1 parent 020ed38 commit 7cb9424

File tree

1 file changed

+9
-1
lines changed
  • src/libraries/System.Runtime.Extensions/tests/System/Diagnostics

1 file changed

+9
-1
lines changed

src/libraries/System.Runtime.Extensions/tests/System/Diagnostics/Stopwatch.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,15 @@ public static class StopwatchTests
1515
public static void GetTimestamp()
1616
{
1717
long ts1 = Stopwatch.GetTimestamp();
18-
Sleep();
18+
if (PlatformDetection.IsBrowser)
19+
{
20+
// workaround for issue: https://github.com/dotnet/runtime/issues/62021
21+
Sleep(5);
22+
}
23+
else
24+
{
25+
Sleep();
26+
}
1927
long ts2 = Stopwatch.GetTimestamp();
2028
Assert.NotEqual(ts1, ts2);
2129
}

0 commit comments

Comments
 (0)