diff options
author | Alexander Köplinger <alex.koeplinger@outlook.com> | 2017-08-31 11:53:35 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-31 11:53:35 +0300 |
commit | e7a2d94f75e00c1f00ebe8bf02b67df7110a0b9a (patch) | |
tree | 98d857fc47b22fd971c867eca01cb7bcfded4edc /mcs/class/System.ServiceModel.Web/Test | |
parent | 2439f17bef29b0bf5ae4fc81a1e7f96514810ff5 (diff) |
[bcl] Fix a few hardcoded socket ports in tests (#5471)
* [System] Fix a few hardcoded socket ports in tests
Those could've shown up as "address already in use" in CI.
* [System.Runtime.Remoting] Fix a few hardcoded socket ports in tests
Those could've shown up as "address already in use" in CI.
Additionally remove a copy of RemotingServicesTest.cs from corlib
which also exists in System.Runtime.Remoting in updated form.
* [System.ServiceModel] Fix a few hardcoded socket ports in tests
Those could've shown up as "address already in use" in CI.
* [System.Net.Http] Fix a few hardcoded socket ports in tests
Those could've shown up as "address already in use" in CI.
The additional "keep-alive" header in Send_Complete_NoContent() and
Send_Transfer_Encoding_Chunked() is because we were using the same
port for all tests before so other tests would clear the header.
This doesn't happen now that we use distinct test ports.
* [System.ServiceModel.Web] Fix a few hardcoded socket ports in tests
Those could've shown up as "address already in use" in CI.
Diffstat (limited to 'mcs/class/System.ServiceModel.Web/Test')
-rw-r--r-- | mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Activation/WebScriptServiceHostFactoryTest.cs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Activation/WebScriptServiceHostFactoryTest.cs b/mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Activation/WebScriptServiceHostFactoryTest.cs index e2af0ca1f76..8f7365939eb 100644 --- a/mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Activation/WebScriptServiceHostFactoryTest.cs +++ b/mcs/class/System.ServiceModel.Web/Test/System.ServiceModel.Activation/WebScriptServiceHostFactoryTest.cs @@ -7,6 +7,8 @@ using System.ServiceModel.Channels; using System.ServiceModel.Web; using NUnit.Framework; +using MonoTests.Helpers; + namespace MonoTests.System.ServiceModel.Activation { class MyHostFactory : WebScriptServiceHostFactory @@ -23,8 +25,9 @@ namespace MonoTests.System.ServiceModel.Activation [Test] public void CreateServiceHost () { + var port = NetworkHelpers.FindFreePort (); var f = new MyHostFactory (); - var host = f.DoCreateServiceHost (typeof (TestService), new Uri [] {new Uri ("http://localhost:37564")}); + var host = f.DoCreateServiceHost (typeof (TestService), new Uri [] {new Uri ($"http://localhost:{port}")}); Assert.IsFalse (host is WebServiceHost, "#1"); host.Open (); host.Close (); @@ -34,8 +37,9 @@ namespace MonoTests.System.ServiceModel.Activation [ExpectedException (typeof (NotSupportedException))] public void ResponseWrappedIsInvalid () { + var port = NetworkHelpers.FindFreePort (); var f = new MyHostFactory (); - var host = f.DoCreateServiceHost (typeof (TestService2), new Uri [] {new Uri ("http://localhost:37564")}); + var host = f.DoCreateServiceHost (typeof (TestService2), new Uri [] {new Uri ($"http://localhost:{port}")}); host.Open (); // should raise an error here. } @@ -43,8 +47,9 @@ namespace MonoTests.System.ServiceModel.Activation [ExpectedException (typeof (InvalidOperationException))] public void MultipleContract () { + var port = NetworkHelpers.FindFreePort (); var f = new MyHostFactory (); - var host = f.DoCreateServiceHost (typeof (TestServiceMultiple), new Uri [] {new Uri ("http://localhost:37564")}); + var host = f.DoCreateServiceHost (typeof (TestServiceMultiple), new Uri [] {new Uri ($"http://localhost:{port}")}); host.Open (); } |