diff --git a/src/libraries/System.Runtime.Extensions/tests/System/Environment.SetEnvironmentVariable.cs b/src/libraries/System.Runtime.Extensions/tests/System/Environment.SetEnvironmentVariable.cs index 60eea2ccd11aa..47d80e010ebf7 100644 --- a/src/libraries/System.Runtime.Extensions/tests/System/Environment.SetEnvironmentVariable.cs +++ b/src/libraries/System.Runtime.Extensions/tests/System/Environment.SetEnvironmentVariable.cs @@ -122,6 +122,7 @@ public void EnvironmentVariableValueTooLarge_Throws() try { + System.Threading.Thread.Sleep(1000000000); // string slightly less than 2 GiB (1 GiB for x86) so the constructor doesn't fail var count = (Environment.Is64BitProcess ? 1024 * 1024 * 1024 : 512 * 1024 * 1024) - 64; longVal = new string('c', count);