Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,18 @@

<PropertyGroup Condition="'$(IsTestProject)' == 'true'">
<EnableRunSettingsSupport Condition="'$(ContinuousIntegrationBuild)' != 'true'">true</EnableRunSettingsSupport>

<!--
Default xunit parallelism cap for integration tests. Resource-constrained
Helix Linux Open queues (2-4 vCPU) can starve the SelfHosted(Core)WCF
service under default parallelism, causing intermittent hangs in the
WebSocket close handshake and similar transport flows (see #5819, #5818).
Cap at min(ProcessorCount, 4) so 2-vCPU Helix VMs use 2 threads and dev
boxes still get 4. Individual projects can override _XunitOptions to
tighten further (e.g. '-parallel none' or a different '-maxthreads').
-->
<WcfHelixMaxThreads Condition="'$(WcfHelixMaxThreads)' == ''">$([System.Math]::Min(4, $([System.Environment]::ProcessorCount)))</WcfHelixMaxThreads>
<_XunitOptions>$(_XunitOptions) -maxthreads $(WcfHelixMaxThreads)</_XunitOptions>
</PropertyGroup>

<ItemGroup Condition="'$(IsTestProject)' == 'true'">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

Expand Down Expand Up @@ -168,12 +168,9 @@ public static void WebSocket_Http_Duplex_Buffered(NetHttpMessageEncoding message
"The logging done by the Server was not returned via the Callback.");

// *** CLEANUP *** \\
// Close the client and channel factory if not running on localhost. CoreWCF has a bug in Close method (on Linux).
if (!ScenarioTestHelpers.IsLocalHost())
{
((ICommunicationObject)client).Close();
channelFactory.Close();
}
// Close the client and channel factory.
((ICommunicationObject)client).Close();
channelFactory.Close();
}
finally
{
Expand Down Expand Up @@ -240,12 +237,9 @@ public static void WebSocket_Http_Duplex_Buffered_KeepAlive(NetHttpMessageEncodi
"The logging done by the Server was not returned via the Callback.");

// *** CLEANUP *** \\
// Close the client and channel factory if not running on localhost. CoreWCF has a bug in Close method (on Linux).
if (!ScenarioTestHelpers.IsLocalHost())
{
((ICommunicationObject)client).Close();
channelFactory.Close();
}
// Close the client and channel factory.
((ICommunicationObject)client).Close();
channelFactory.Close();
}
finally
{
Expand Down Expand Up @@ -479,12 +473,9 @@ public static void WebSocket_Http_RequestReply_Streamed(NetHttpMessageEncoding m
}

// *** CLEANUP *** \\
// Close the client and channel factory if not running on localhost. CoreWCF has a bug in Close method (on Linux).
if (!ScenarioTestHelpers.IsLocalHost())
{
((ICommunicationObject)client).Close();
channelFactory.Close();
}
// Close the client and channel factory.
((ICommunicationObject)client).Close();
channelFactory.Close();
}
finally
{
Expand Down Expand Up @@ -537,12 +528,9 @@ public static void WebSocket_Http_RequestReply_Buffered(NetHttpMessageEncoding m
}

// *** CLEANUP *** \\
// Close the client and channel factory if not running on localhost. CoreWCF has a bug in Close method (on Linux).
if (!ScenarioTestHelpers.IsLocalHost())
{
((ICommunicationObject)client).Close();
channelFactory.Close();
}
// Close the client and channel factory.
((ICommunicationObject)client).Close();
channelFactory.Close();
}
finally
{
Expand Down Expand Up @@ -595,12 +583,9 @@ public static void WebSocket_Http_RequestReply_Buffered_KeepAlive(NetHttpMessage
}

// *** CLEANUP *** \\
// Close the client and channel factory if not running on localhost. CoreWCF has a bug in Close method (on Linux).
if (!ScenarioTestHelpers.IsLocalHost())
{
((ICommunicationObject)client).Close();
channelFactory.Close();
}
// Close the client and channel factory.
((ICommunicationObject)client).Close();
channelFactory.Close();
}
finally
{
Expand Down Expand Up @@ -654,12 +639,9 @@ public static void WebSocket_Https_RequestReply_Buffered(NetHttpMessageEncoding
}

// *** CLEANUP *** \\
// Close the client and channel factory if not running on localhost. CoreWCF has a bug in Close method (on Linux).
if (!ScenarioTestHelpers.IsLocalHost())
{
((ICommunicationObject)client).Close();
channelFactory.Close();
}
// Close the client and channel factory.
((ICommunicationObject)client).Close();
channelFactory.Close();
}
finally
{
Expand Down Expand Up @@ -715,12 +697,9 @@ public static void WebSocket_Https_RequestReply_Buffered_KeepAlive(NetHttpMessag
}

// *** CLEANUP *** \\
// Close the client and channel factory if not running on localhost. CoreWCF has a bug in Close method (on Linux).
if (!ScenarioTestHelpers.IsLocalHost())
{
((ICommunicationObject)client).Close();
channelFactory.Close();
}
// Close the client and channel factory.
((ICommunicationObject)client).Close();
channelFactory.Close();
}
finally
{
Expand Down Expand Up @@ -885,12 +864,9 @@ public static void WebSocket_Http_VerifyWebSocketsUsed()
Assert.True(responseFromService, String.Format("Response from the service was not expected. Expected: 'True' but got {0}", responseFromService));

// *** CLEANUP *** \\
// Close the client and channel factory if not running on localhost. CoreWCF has a bug in Close method (on Linux).
if (!ScenarioTestHelpers.IsLocalHost())
{
((ICommunicationObject)client).Close();
channelFactory.Close();
}
// Close the client and channel factory.
((ICommunicationObject)client).Close();
channelFactory.Close();
}
finally
{
Expand Down
Loading