Reduce RemoteInvoke usage in tests (dotnet/corefx#41741)
authorStephen Toub <stoub@microsoft.com>
Tue, 15 Oct 2019 16:09:06 +0000 (12:09 -0400)
committerGitHub <noreply@github.com>
Tue, 15 Oct 2019 16:09:06 +0000 (12:09 -0400)
commit7ff3a1100a4ed6f48711d6f7ec43eaba374668a3
tree4e7b745c61a8ae30557639a6b890ab3721add779
parent2d0b4d55d878fc3bb334b2597c81b9539ce01018
Reduce RemoteInvoke usage in tests (dotnet/corefx#41741)

Many of our RemoteInvokes are there purely because of needing to change the current thread culture but on UAP that actually impacting the whole process.  Until that's addressed, we can at least avoid the RemoteInvoke on all platforms other than UAP. There are also some RemoteInvokes that can be avoided by just serializing all of the (small number of) tests in a test assembly. And there's some additional cleanup to be done as well around not explicitly returning an exit code unless required.

This helps measurably with test performance.  Consider the System.ComponentModel.Annotations test suite.  On my machine, prior to these changes, it took ~25 seconds; after these changes, it takes ~0.3. It helps even more when running against a checked runtime, where all of our test costs are magnified.  With a checked runtime, prior to these changes, it takes ~196 seconds; after these changes, it takes ~2.5 seconds.  This should help measurably with CI time in coreclr.

Commit migrated from https://github.com/dotnet/corefx/commit/cd18bafbabf7fe47601f6f790d157409034a2477
133 files changed:
src/libraries/Common/tests/CoreFx.Private.TestUtilities/CoreFx.Private.TestUtilities.csproj
src/libraries/Common/tests/CoreFx.Private.TestUtilities/System/Diagnostics/RemoteExecutorForUap.cs [new file with mode: 0644]
src/libraries/Common/tests/CoreFx.Private.TestUtilities/System/ThreadCultureChange.cs [new file with mode: 0644]
src/libraries/Common/tests/System/ThreadCultureChange.cs [deleted file]
src/libraries/Common/tests/Tests/System/StringTests.cs
src/libraries/Microsoft.VisualBasic.Core/tests/StringsTests.cs
src/libraries/System.Buffers/tests/ArrayPool/ArrayPoolTest.cs
src/libraries/System.Buffers/tests/ArrayPool/CollectionTests.cs
src/libraries/System.CodeDom/tests/System/CodeDom/Compiler/CSharpCodeGenerationTests.cs
src/libraries/System.CodeDom/tests/System/CodeDom/Compiler/VBCodeGenerationTests.cs
src/libraries/System.Collections.NonGeneric/tests/CaseInsensitiveComparerTests.cs
src/libraries/System.Collections.NonGeneric/tests/CaseInsensitiveHashCodeProviderTests.cs
src/libraries/System.Collections.NonGeneric/tests/ComparerTests.cs
src/libraries/System.Collections.NonGeneric/tests/HashtableTests.cs
src/libraries/System.Collections.NonGeneric/tests/SortedListTests.cs
src/libraries/System.ComponentModel.Annotations/tests/System/ComponentModel/DataAnnotations/RangeAttributeTests.cs
src/libraries/System.ComponentModel.Composition/tests/System.ComponentModel.Composition.Tests.csproj
src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/CompositionExceptionTests.cs
src/libraries/System.ComponentModel.EventBasedAsync/tests/AsyncOperationFinalizerTests.cs
src/libraries/System.ComponentModel.TypeConverter/tests/Design/DesignerOptionServiceTests.cs
src/libraries/System.ComponentModel.TypeConverter/tests/MultilineStringConverterTests.cs
src/libraries/System.ComponentModel.TypeConverter/tests/TypeConverterTestBase.cs
src/libraries/System.ComponentModel.TypeConverter/tests/TypeConverterTests.cs
src/libraries/System.ComponentModel.TypeConverter/tests/TypeListConverterTests.cs
src/libraries/System.Configuration.ConfigurationManager/tests/System/Configuration/TimeSpanValidatorAttributeTests.cs
src/libraries/System.Console/tests/CancelKeyPress.Unix.cs
src/libraries/System.Console/tests/CancelKeyPress.cs
src/libraries/System.Console/tests/ConsoleEncoding.Windows.cs
src/libraries/System.Console/tests/ConsoleEncoding.cs
src/libraries/System.Console/tests/NonStandardConfiguration.Unix.cs
src/libraries/System.Console/tests/WindowAndCursorProps.cs
src/libraries/System.Data.Common/tests/System/Data/DataSetReadXmlSchemaTest.cs
src/libraries/System.Data.Common/tests/System/Data/DataSetTest.cs
src/libraries/System.Data.Common/tests/System/Data/DataSetTest2.cs
src/libraries/System.Data.Common/tests/System/Data/DataTableReadXmlSchemaTest.cs
src/libraries/System.Data.Common/tests/System/Data/DataTableTest.cs
src/libraries/System.Data.Common/tests/System/Data/SqlTypes/SqlStringTest.cs
src/libraries/System.Data.SqlClient/tests/FunctionalTests/DiagnosticTest.cs
src/libraries/System.Diagnostics.TextWriterTraceListener/tests/ConsoleTraceListenerTests.cs
src/libraries/System.Drawing.Common/tests/ColorTranslatorTests.cs
src/libraries/System.Drawing.Common/tests/IconTests.cs
src/libraries/System.Drawing.Common/tests/System.Drawing.Common.Tests.csproj
src/libraries/System.Drawing.Primitives/tests/ColorTranslatorTests.cs
src/libraries/System.Drawing.Primitives/tests/System.Drawing.Primitives.Tests.csproj
src/libraries/System.Globalization/tests/CultureInfo/CultureInfoAsync.cs
src/libraries/System.Globalization/tests/CultureInfo/CultureInfoCurrentCulture.cs
src/libraries/System.Globalization/tests/CultureInfo/CultureInfoDateTimeFormat.cs
src/libraries/System.Globalization/tests/NumberFormatInfo/NumberFormatInfoCurrentInfo.cs
src/libraries/System.Globalization/tests/System/Globalization/RegionInfoTests.cs
src/libraries/System.IO.FileSystem/tests/Directory/GetFileSystemEntries_str.cs
src/libraries/System.IO.FileSystem/tests/Directory/SetCurrentDirectory.cs
src/libraries/System.IO.FileSystem/tests/FileInfo/Exists.cs
src/libraries/System.IO.FileSystem/tests/FileStream/Dispose.cs
src/libraries/System.IO.FileSystem/tests/FileStream/LockUnlock.cs
src/libraries/System.IO.FileSystem/tests/FileStream/Name.cs
src/libraries/System.IO.FileSystem/tests/FileStream/ctor_str_fm_fa_fs.cs
src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.CrossProcess.cs
src/libraries/System.IO.Pipes/tests/AnonymousPipeTests/AnonymousPipeTest.CrossProcess.cs
src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CrossProcess.cs
src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CurrentUserOnly.netcoreapp.Unix.cs
src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.RunAsClient.Unix.cs
src/libraries/System.IO/tests/StringWriter/StringWriterTests.cs
src/libraries/System.Json/tests/System/Json/JsonValueTests.cs
src/libraries/System.Net.Http/tests/FunctionalTests/DiagnosticsTests.cs
src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.ClientCertificates.cs
src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.DefaultProxyCredentials.cs
src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.Proxy.cs
src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.ServerCertificates.Unix.cs
src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.ServerCertificates.cs
src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientHandlerTest.cs
src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientTest.netcoreapp.cs
src/libraries/System.Net.Http/tests/FunctionalTests/PostScenarioUWPTest.cs
src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs
src/libraries/System.Net.Http/tests/UnitTests/HttpEnvironmentProxyTest.cs
src/libraries/System.Net.Http/tests/UnitTests/HttpWindowsProxyTest.cs
src/libraries/System.Net.Http/tests/UnitTests/SystemProxyInfoTest.cs
src/libraries/System.Net.Mail/tests/Functional/LoggingTest.cs
src/libraries/System.Net.Primitives/tests/FunctionalTests/LoggingTest.cs
src/libraries/System.Net.Requests/tests/AuthenticationManagerTest.cs
src/libraries/System.Net.Requests/tests/GlobalProxySelectionTest.cs
src/libraries/System.Net.Requests/tests/HttpWebRequestTest.cs
src/libraries/System.Net.Requests/tests/WebRequestTest.cs
src/libraries/System.Net.Security/tests/FunctionalTests/LoggingTest.cs
src/libraries/System.Net.ServicePoint/tests/ServicePointManagerTest.cs
src/libraries/System.Net.ServicePoint/tests/TlsSystemDefault.cs
src/libraries/System.Net.ServicePoint/tests/XunitAssemblyAttributes.cs [new file with mode: 0644]
src/libraries/System.Net.Sockets/tests/FunctionalTests/LoggingTest.cs
src/libraries/System.Net.WebSockets.Client/tests/ClientWebSocketUnitTest.cs
src/libraries/System.Net.WebSockets.Client/tests/System.Net.WebSockets.Client.Tests.csproj
src/libraries/System.Private.Uri/tests/ExtendedFunctionalTests/System.Private.Uri.ExtendedFunctional.Tests.csproj
src/libraries/System.Private.Uri/tests/FunctionalTests/IdnCheckHostNameTest.cs
src/libraries/System.Private.Uri/tests/FunctionalTests/IriTest.cs
src/libraries/System.Private.Uri/tests/FunctionalTests/System.Private.Uri.Functional.Tests.csproj
src/libraries/System.Private.Uri/tests/FunctionalTests/UriEscapingTest.cs
src/libraries/System.Private.Uri/tests/UnitTests/IriEscapeUnescapeTest.cs
src/libraries/System.Private.Uri/tests/UnitTests/System.Private.Uri.Unit.Tests.csproj
src/libraries/System.Runtime.Extensions/tests/System/AppDomainTests.cs
src/libraries/System.Runtime.Extensions/tests/System/AppDomainTests.netcoreapp.cs
src/libraries/System.Runtime.Extensions/tests/System/EnvironmentTests.cs
src/libraries/System.Runtime.Extensions/tests/System/UnloadingAndProcessExitTests.netcoreapp.cs
src/libraries/System.Runtime.Loader/tests/ContextualReflection.cs
src/libraries/System.Runtime.Numerics/tests/BigInteger/BigIntegerToStringTests.cs
src/libraries/System.Runtime.Numerics/tests/BigInteger/parse.cs
src/libraries/System.Runtime.Serialization.Formatters/tests/BinaryFormatterTestData.cs
src/libraries/System.Runtime.Serialization.Formatters/tests/BinaryFormatterTests.cs
src/libraries/System.Runtime.Serialization.Formatters/tests/System.Runtime.Serialization.Formatters.Tests.csproj
src/libraries/System.Runtime/tests/System/DecimalTests.cs
src/libraries/System.Runtime/tests/System/DecimalTests.netcoreapp.cs
src/libraries/System.Runtime/tests/System/DoubleTests.cs
src/libraries/System.Runtime/tests/System/DoubleTests.netcoreapp.cs
src/libraries/System.Runtime/tests/System/FormattableStringTests.cs
src/libraries/System.Runtime/tests/System/FormattableStringTests.netcoreapp.cs
src/libraries/System.Runtime/tests/System/GCTests.cs
src/libraries/System.Runtime/tests/System/Reflection/IsCollectibleTests.cs
src/libraries/System.Runtime/tests/System/Runtime/ExceptionServices/HandleProcessCorruptedStateExceptions.cs
src/libraries/System.Runtime/tests/System/SingleTests.cs
src/libraries/System.Runtime/tests/System/SingleTests.netcoreapp.cs
src/libraries/System.Runtime/tests/System/StringTests.netcoreapp.cs
src/libraries/System.Runtime/tests/System/Text/StringBuilderTests.cs
src/libraries/System.Runtime/tests/System/Type/TypeTests.cs
src/libraries/System.Security.Cryptography.X509Certificates/tests/X509StoreTests.cs
src/libraries/System.Text.Encoding/tests/Encoding/EncodingGetEncodingTests.cs
src/libraries/System.Text.RegularExpressions/tests/Regex.Cache.Tests.cs
src/libraries/System.Text.RegularExpressions/tests/Regex.Ctor.Tests.cs
src/libraries/System.Text.RegularExpressions/tests/Regex.Groups.Tests.cs
src/libraries/System.Text.RegularExpressions/tests/Regex.Match.Tests.cs
src/libraries/System.Text.RegularExpressions/tests/RegexCultureTests.cs
src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/EtwTests.cs
src/libraries/System.Threading.Tasks/tests/System.Runtime.CompilerServices/AsyncTaskMethodBuilderTests.netcoreapp.cs
src/libraries/System.Threading/tests/EventWaitHandleTests.cs
src/libraries/System.Threading/tests/MutexTests.cs
src/libraries/System.Threading/tests/SemaphoreTests.cs
src/libraries/System.Utf8String.Experimental/tests/System/Utf8SpanTests.Comparison.cs