Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scenario test for channel extensibility model #1171

Merged
merged 1 commit into from
May 20, 2016

Conversation

khdang
Copy link
Member

@khdang khdang commented May 17, 2016

I've ported the Custom Message Interceptor but it seems that the channel extensibility model doesn't work yet.

Ref #623 #1170

@khdang
Copy link
Member Author

khdang commented May 17, 2016

@dotnet-bot test outerloop Windows_NT
@dotnet-bot test outerloop selfhost Windows_NT

@roncain
Copy link
Contributor

roncain commented May 17, 2016

@khdang could you rebase and try again? All the Outerloop tests failed in unexpected ways. The selfhost failure has a compile error, meaning you are probably also failing to build under IIS.

@roncain
Copy link
Contributor

roncain commented May 17, 2016

If you try to build tools\SelfHostedWcfService\SelfHostedWcfService.sln you will see many compile errors. This explains why all OuterLoops fail because neither self-host nor IIS-host can build the server side code.

After rebasing and resolving the merge conflicts reported, please do 'build /p:WithCategories=OuterLoop' to verify the code runs before updating the PR


In reply to: 219699069 [](ancestors = 219699069)

using System.ServiceModel;
using System.ServiceModel.Channels;

namespace WcfService
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is in the wrong place. All server-side .cs files live under the IISHostedWcfService\App_code folder and are included by the self-host project. Was there some reason you could not put this in IISHostedWcfService?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was not intentional I'll move this to IISHostedWcfService\App_code folder

@roncain
Copy link
Contributor

roncain commented May 17, 2016

I think the tests really belong in a new folder under Scenarios/Extensibility. This is all about the extensibility at the channel layer and less about testing CustomBinding.
@StephenBonikowsky -- thoughts on correct placement?

@StephenBonikowsky
Copy link
Member

Yes I agree, this test is meant to replace the old test we had that was based on the Mahjong game to test the MessageInspector scenario.
I think you should place it under Scenarios/Extensibility in a new "MessageInspector" directory.

Also, there are a lot of extra files needed for the test, I would recommend putting the test itself in a MessageInspectorTests.cs and all the other files under another subdirectory called "TestData", I plan on going back and making this same kind of change in other test folders, this way it is easy to differentiate files containing the tests and any other supporting files.

You will need to add a new *.csproj and add it to the solution.

@@ -51,4 +51,69 @@ public static void DefaultSettings_Tcp_Binary_Echo_RoundTrips_String()
ScenarioTestHelpers.CloseCommunicationObjects((ICommunicationObject)serviceProxy, factory);
}
}

public class MessageModifier : ChannelMessageInterceptor
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test files should only contain test methods, could you move this to a separate file or into one of the other test support files you already have.

I have a task to clean this up in other areas of our test bed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Ron and Stephen! That makes sense. Let me move this new test to Scenarios/Extensibility

@khdang khdang force-pushed the add_scenario_tests_extensiblity_model branch 2 times, most recently from a96dc07 to 083bea4 Compare May 17, 2016 22:54
@khdang
Copy link
Member Author

khdang commented May 17, 2016

@dotnet-bot test outerloop Windows_NT
@dotnet-bot test outerloop selfhost Windows_NT

@khdang khdang force-pushed the add_scenario_tests_extensiblity_model branch from 083bea4 to 42f84cf Compare May 17, 2016 22:58

[Fact]
[OuterLoop]
[ActiveIssue(1170)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to understand why this test fails before we disable it. @khdang , can this test be changed to pass, or do we understand the failure enough to know it is a product issue?

@roncain
Copy link
Contributor

roncain commented May 18, 2016

@dotnet-bot test outerloop Windows_NT
@dotnet-bot test outerloop selfhost Windows_NT

@roncain
Copy link
Contributor

roncain commented May 18, 2016

@khdang -- would you please ping this PR when it is ready to review? It still fails to build, which is why you get a 100% failure rate in OuterLoops. You can see this by building SelfHostedWcfService.sln. These same errors will occur when IIS attempts to build the contents of its virtual directory, meaning no WCF services are available.

Build FAILED.

"c:\OSS\wcf\src\System.Private.ServiceModel\tools\SelfHostedWcfService\SelfHostedWCFService.sln" (default target) (1) ->
"c:\OSS\wcf\src\System.Private.ServiceModel\tools\SelfHostedWcfService\SelfHostedWCFService.csproj" (default target) (2) ->
(CoreCompile target) -> 
  c:\OSS\wcf\src\System.Private.ServiceModel\tools\IISHostedWcfService\App_code\AsyncResult.cs(121,17): error CS0103: The name 'callback' does not exist in the current context [c:\OSS\wcf\src\System.Private.ServiceModel\tools\SelfHostedWcfService\SelfHostedWCFService.csproj]
  c:\OSS\wcf\src\System.Private.ServiceModel\tools\IISHostedWcfService\App_code\AsyncResult.cs(150,29): error CS1061: 'TAsyncResult' does not contain a definition for 'endCalled' and no extension method 'endCalled' accepting a first argument of type 'TAsyncResult' could be found (are you missing a using directive or an assembly reference?) [c:\OSS\wcf\src\System.Private.ServiceModel\tools\SelfHostedWcfService\SelfHostedWCFService.csproj]
  c:\OSS\wcf\src\System.Private.ServiceModel\tools\IISHostedWcfService\App_code\AsyncResult.cs(155,25): error CS1061: 'TAsyncResult' does not contain a definition for 'endCalled' and no extension method 'endCalled' accepting a first argument of type 'TAsyncResult' could be found (are you missing a using directive or an assembly reference?) [c:\OSS\wcf\src\System.Private.ServiceModel\tools\SelfHostedWcfService\SelfHostedWCFService.csproj]
  c:\OSS\wcf\src\System.Private.ServiceModel\tools\IISHostedWcfService\App_code\AsyncResult.cs(157,30): error CS1061: 'TAsyncResult' does not contain a definition for 'isCompleted' and no extension method 'isCompleted' accepting a first argument of type 'TAsyncResult' could be found (are you missing a using directive or an assembly reference?) [c:\OSS\wcf\src\System.Private.ServiceModel\tools\SelfHostedWcfService\SelfHostedWCFService.csproj]
  c:\OSS\wcf\src\System.Private.ServiceModel\tools\IISHostedWcfService\App_code\AsyncResult.cs(162,29): error CS1061: 'TAsyncResult' does not contain a definition for 'manualResetEvent' and no extension method 'manualResetEvent' accepting a first argument of type 'TAsyncResult' could be found (are you missing a using directive or an assembly reference?) [c:\OSS\wcf\src\System.Private.ServiceModel\tools\SelfHostedWcfService\SelfHostedWCFService.csproj]
  c:\OSS\wcf\src\System.Private.ServiceModel\tools\IISHostedWcfService\App_code\AsyncResult.cs(164,29): error CS1061: 'TAsyncResult' does not contain a definition for 'manualResetEvent' and no extension method 'manualResetEvent' accepting a first argument of type 'TAsyncResult' could be found (are you missing a using directive or an assembly reference?) [c:\OSS\wcf\src\System.Private.ServiceModel\tools\SelfHostedWcfService\SelfHostedWCFService.csproj]
  c:\OSS\wcf\src\System.Private.ServiceModel\tools\IISHostedWcfService\App_code\AsyncResult.cs(167,29): error CS1061: 'TAsyncResult' does not contain a definition for 'exception' and no extension method 'exception' accepting a first argument of type 'TAsyncResult' could be found (are you missing a using directive or an assembly reference?) [c:\OSS\wcf\src\System.Private.ServiceModel\tools\SelfHostedWcfService\SelfHostedWCFService.csproj]
  c:\OSS\wcf\src\System.Private.ServiceModel\tools\IISHostedWcfService\App_code\AsyncResult.cs(169,35): error CS1061: 'TAsyncResult' does not contain a definition for 'exception' and no extension method 'exception' accepting a first argument of type 'TAsyncResult' could be found (are you missing a using directive or an assembly reference?) [c:\OSS\wcf\src\System.Private.ServiceModel\tools\SelfHostedWcfService\SelfHostedWCFService.csproj]

    0 Warning(s)
    8 Error(s)

@khdang
Copy link
Member Author

khdang commented May 18, 2016

Initially I run StartWCFSelfHostedService.cmd and it went pass the "Building WCF Self hosted sevice.." step without error so I thought there is no issues with the build. But I did notice the errors in your previous comments. Let me resolve that.

@khdang
Copy link
Member Author

khdang commented May 19, 2016

@dotnet-bot test outerloop Windows_NT
@dotnet-bot test outerloop selfhost Windows_NT

@khdang
Copy link
Member Author

khdang commented May 19, 2016

I've fixed the errors when building SelfHostedWCFService. It's a bug in CodeFormatter that it doesn't rename all the occurrences of variables.

I've fixed the tests issue as well by opening channels properly. I think this should verify that the channel extensibility model works.

As for #623 2nd task, the LayeredChannel doesn't seem to be covered with this test so that need to be done separately.

@khdang
Copy link
Member Author

khdang commented May 19, 2016

It looks like I need to update the test service for the new tests.

Starting:    Extensibility.MessageInterceptor.Tests
14:04:14      MessageInterceptorTests.CustomBinding_Message_Interceptor [FAIL]
14:04:14         System.ServiceModel.EndpointNotFoundException : There was no endpoint listening at http://wcfcoresrv2.cloudapp.net/WcfService15//ChannelExtensibility.svc//ChannelExtensibility that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
14:04:14         Stack Trace:

@@ -39,6 +39,7 @@
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.configuration" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: System.Configuration (upper-case 'C")

@roncain
Copy link
Contributor

roncain commented May 19, 2016

LGTM subject to a couple things:

  • Get CI to pass Windows OuterLoops by updating the web.config as mentioned in a comment
  • Once that passes, ask to run all outerloops (look at other PR's that contain "test all outerloop " -- I don't want to make trigger it by accident 😀)
  • Consider renaming the one file to match the casing of the class name

Once we get an CI OuterLoop pass for all OSes, I'm fine merging this.

@khdang
Copy link
Member Author

khdang commented May 20, 2016

@dotnet-bot test outerloop Windows_NT
@dotnet-bot test outerloop selfhost Windows_NT

@khdang
Copy link
Member Author

khdang commented May 20, 2016

@dotnet-bot test all outerloop please

@khdang
Copy link
Member Author

khdang commented May 20, 2016

@dotnet-bot test OuterLoop Selfhost Windows_NT Release
@dotnet-bot test OuterLoop Ubuntu14.04 Debug
@dotnet-bot test OuterLoop Ubuntu14.04 Release

@roncain
Copy link
Contributor

roncain commented May 20, 2016

@khdang -- I think the Ubuntu and OSX OuterLoop failures are unrelated to your PR, and you should go ahead and merge.
Looking at the failures, it looks like the PRService is encountering problems attempting to initialize the build tools. If I sync my Ubuntu VM to your PR and run exactly the same build script that PRService attempted (found in the console log for the failure in the Details link), I actually see the new MessageInspector test run and pass. I think we need to investigate the PR machine separately to discover why it failed to init the build tools -- but don't block this PR on that.

/cc: @iamjasonp

@khdang
Copy link
Member Author

khdang commented May 20, 2016

Thanks @roncain! I will squash the commits and merge.

@khdang khdang force-pushed the add_scenario_tests_extensiblity_model branch from ab0b94e to bbaeb92 Compare May 20, 2016 16:52
@khdang
Copy link
Member Author

khdang commented May 20, 2016

@dotnet-bot test all outerloop please

@iamjasonp
Copy link
Member

ACK - issues look transient to me

@roncain
Copy link
Contributor

roncain commented May 20, 2016

LGTM. I recommend checking in asap @khdang -- today is the last day before we branch.
The one failing test is not related to this PR. I think it is a flakey test and I will fix that separately.

@khdang khdang merged commit 45dbfc2 into dotnet:master May 20, 2016
@khdang khdang deleted the add_scenario_tests_extensiblity_model branch May 20, 2016 20:21
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.

6 participants