[Wasm] Reduce max length on browser for ToArrayShouldWorkWithSpecialLengthLazyEnumera...
authorSteve Pfister <steveisok@users.noreply.github.com>
Mon, 24 Aug 2020 15:21:29 +0000 (11:21 -0400)
committerGitHub <noreply@github.com>
Mon, 24 Aug 2020 15:21:29 +0000 (17:21 +0200)
Addresses the occasional timeouts in System.Linq tests.  The last 3-4 iterations of ToArrayShouldWorkWithSpecialLengthLazyEnumerables take
between 20 - 56 seconds each and likely trigger longer GC runs.

Fixes https://github.com/dotnet/runtime/issues/41114

Co-authored-by: Steve Pfister <steve.pfister@microsoft.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
src/libraries/System.Linq/tests/ToArrayTests.cs

index 8116e30..b487778 100644 (file)
@@ -371,7 +371,7 @@ namespace System.Linq.Tests
         public static IEnumerable<object[]> ToArrayShouldWorkWithSpecialLengthLazyEnumerables_MemberData()
         {
             // Return array sizes that should be small enough not to OOM
-            const int MaxPower = 18;
+            int MaxPower = PlatformDetection.IsBrowser ? 15 : 18;
             yield return new object[] { 1 };
             yield return new object[] { 2 };
             for (int i = 2; i <= MaxPower; i++)