Skip to content

Commit

Permalink
Fixing a flaky test.
Browse files Browse the repository at this point in the history
* Test case "NetTcp_TransportSecurity_Streamed_TimeOut_Long_Running_Operation" is just testing the 'SendTimeout' property on the binding, to make sure it is working as expected we only pass the test when the elapsed time falls within a narrow range.
* This test has occasionally been failing by taking longer than expected, we don't believe this is a product bug most likely caused because we were not explicitly opening the channel before starting the Stopwatch, by doing this we are remove this small but variable amount of time that was getting added to the elapsed time calculation.
  • Loading branch information
StephenBonikowsky committed Nov 9, 2016
1 parent 24a97e8 commit b4ff682
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ public static void NetTcp_TransportSecurity_Streamed_TimeOut_Long_Running_Operat
binding.SendTimeout = TimeSpan.FromMilliseconds(5000);
factory = new ChannelFactory<IWcfService>(binding, new EndpointAddress(Endpoints.Tcp_Transport_Security_Streamed_Address));
serviceProxy = factory.CreateChannel();
((ICommunicationObject)serviceProxy).Open();
Stopwatch watch = new Stopwatch();
watch.Start();

Expand Down

0 comments on commit b4ff682

Please sign in to comment.