Skip to content

Un-skip CoreWCF-compatible tests; strengthen Mandatory transaction-fl…#5952

Open
afifi-ins wants to merge 2 commits into
dotnet:mainfrom
afifi-ins:remove-skip-corewcf-condition
Open

Un-skip CoreWCF-compatible tests; strengthen Mandatory transaction-fl…#5952
afifi-ins wants to merge 2 commits into
dotnet:mainfrom
afifi-ins:remove-skip-corewcf-condition

Conversation

@afifi-ins
Copy link
Copy Markdown
Contributor

After investigating every test gated by [Condition(nameof(Skip_CoreWCFService_FailedTest))], the following tests are now confirmed passing against the SelfHostedCoreWcfService and have their CoreWCF skip removed:

  • Client/ClientBase/ClientBaseTests.DefaultSettings_SetCookieOnServerSide
  • Extensibility/WebSockets/WebSocketTests.WebSocket_Https_Duplex_Buffered
  • Security/TransportSecurity/Tcp/Tcp_ClientCredentialTypeCertificateCanonicalNameTests
    • Certificate_With_CanonicalName_DomainName_Address_EchoString
    • Certificate_With_CanonicalName_Fqdn_Address_EchoString

WSHttpBinding_TransactionFlow_Mandatory_WithoutScope_Throws was originally observed to pass under CoreWCF as well, but that turned out to be a false positive: the test asserts only the client-side ProtocolException thrown by TransactionChannel before any wire activity (verified by running the test with no service at all, in 168ms). To make the test actually exercise CoreWCF's TransactionFlow support, the test has been:

  • Renamed to WSHttpBinding_TransactionFlow_Mandatory_RoundTrips_And_WithoutScope_Throws
  • Extended with a positive-case round-trip inside a TransactionScope that asserts the server sees the flowed transaction (IsTransactionFlowed returns true)
  • Kept gated by Skip_CoreWCFService_FailedTest because CoreWCF does not register the WSHttpTransactionFlowMandatory.svc endpoint (the host class is wrapped in #if !NET).

Verification matrix:

  • .NET Framework SelfHostedWcfService (net471): strengthened test PASSES in 3s
  • SelfHostedCoreWcfService (RunWithCoreWCF=true): strengthened test FAILS with EndpointNotFoundException at the new positive branch when the skip condition is temporarily removed, and is correctly SKIPPED with the condition in place.

afifi-ins and others added 2 commits May 23, 2026 08:19
…ow test

After investigating every test gated by [Condition(nameof(Skip_CoreWCFService_FailedTest))],
the following tests are now confirmed passing against the SelfHostedCoreWcfService and
have their CoreWCF skip removed:

  * Client/ClientBase/ClientBaseTests.DefaultSettings_SetCookieOnServerSide
  * Extensibility/WebSockets/WebSocketTests.WebSocket_Https_Duplex_Buffered
  * Security/TransportSecurity/Tcp/Tcp_ClientCredentialTypeCertificateCanonicalNameTests
      - Certificate_With_CanonicalName_DomainName_Address_EchoString
      - Certificate_With_CanonicalName_Fqdn_Address_EchoString

Verified on Windows (Windows 10 26200) and WSL Ubuntu-24.04 with the CoreWCF self-host
running locally on http://localhost:8081.

WSHttpBinding_TransactionFlow_Mandatory_WithoutScope_Throws was originally observed to
pass under CoreWCF as well, but that turned out to be a false positive: the test asserts
only the client-side ProtocolException thrown by TransactionChannel before any wire
activity (verified by running the test with no service at all, in 168ms). To make the
test actually exercise CoreWCF's TransactionFlow support, the test has been:

  * Renamed to WSHttpBinding_TransactionFlow_Mandatory_RoundTrips_And_WithoutScope_Throws
  * Extended with a positive-case round-trip inside a TransactionScope that asserts the
    server sees the flowed transaction (IsTransactionFlowed returns true)
  * Kept gated by Skip_CoreWCFService_FailedTest because CoreWCF does not register the
    WSHttpTransactionFlowMandatory.svc endpoint (the host class is wrapped in #if !NET).

Verification matrix:
  * .NET Framework SelfHostedWcfService (net471): strengthened test PASSES in 3s
  * SelfHostedCoreWcfService (RunWithCoreWCF=true): strengthened test FAILS with
    EndpointNotFoundException at the new positive branch when the skip condition is
    temporarily removed, and is correctly SKIPPED with the condition in place.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pipeline run for PR dotnet#5952 surfaced two Linux-specific issues with tests this
PR had un-skipped under CoreWCF. Both failures reproduce against the
SelfHostedCoreWcfService on Helix Linux but pass on Windows.

1) Tcp_ClientCredentialTypeCertificateCanonicalNameTests:
   .Certificate_With_CanonicalName_DomainName_Address_EchoString
   .Certificate_With_CanonicalName_Fqdn_Address_EchoString
   On Linux containers Dns.GetHostEntry("127.0.0.1").HostName resolves to
   "localhost" (verified with getent hosts 127.0.0.1). CertificateGenerator
   uses that value as the subject CN for the "DomainName" / "Fqdn" certs
   (CertificateGeneratorLibrary.cs:17-18), so on Linux those certs are
   indistinguishable from the Localhost cert. The tests assert a NEGATIVE
   case ("connect to localhost -> server presents DomainName cert -> identity
   check must fail"), which can never hold when the cert CN is also
   "localhost". This is a pre-existing test-infra limitation unrelated to
   CoreWCF; the tests also fail on Linux against a real WCF service.
   Fix: gate on Is_Windows in addition to Root_Certificate_Installed.

2) ClientBaseTests.DefaultSettings_SetCookieOnServerSide:
   Server-side Kestrel race on certain Linux distros (Fedora.41, Debian.12;
   passes on Ubuntu, AzureLinux, openSUSE on the same Helix run):

       Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets[14] communication error.
       System.InvalidOperationException: Writing is not allowed after writer was completed.
          at System.IO.Pipelines.Pipe.GetMemory(Int32 sizeHint)
          at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.Internal.SocketConnection.DoReceive()

   The second POST on the keep-alive connection occasionally hits a
   CoreWCF/Kestrel pipe-writer race and the client receives a
   "Connection reset by peer". Not addressable client-side.
   Fix: restore [Condition(nameof(Skip_CoreWCFService_FailedTest))] with a
   comment explaining the failure mode.

Other un-skipped tests in the PR (WebSocket_Https_Duplex_Buffered and the
strengthened WSHttpBinding_TransactionFlow_Mandatory_RoundTrips_And_WithoutScope_Throws)
remain unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant