This project is read-only.

Load test with Transmock

Nov 13, 2015 at 2:35 PM
Edited Nov 13, 2015 at 2:48 PM
Hi Svet,

My functional testing with Transmock is now working very well :)

I thought I'd try a simple load test and so wrapped a test with a for loop as follows:
 [TestMethod]
        [DeploymentItem(@"TestInput\Stk_LargeInvarUpdate.xml")]
        public void LoadTest_InvarStockUpdate()
        {
            int i = 0;

            TestCase testCase = new TestCase();

            for (i = 0; i < 10; i++)
            {
                var sendStockStep = new MockSendStep()
                {
                    RequestPath = "Stk_LargeInvarUpdate.xml",
                    Encoding = "UTF-8",
                    Url = MockEndpoints.ReceiveInvarStockProcess
                };

                testCase.ExecutionSteps.Add(sendStockStep);
            }

            BizUnit.BizUnit testRunner = new BizUnit.BizUnit(testCase);

            testRunner.RunTest();
        }
When I run this test I get the following exception:
Message: Pipe hasn't been connected yet.
Stack Trace: at System.IO.Pipes.PipeStream.CheckWriteOperations()
at System.IO.Pipes.PipeStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at TransMock.Communication.NamedPipes.StreamingNamedPipeClient.WriteStream(Stream data)
at TransMock.Integration.BizUnit.MockSendStep.SendRequest(Context context)
at TransMock.Integration.BizUnit.MockSendStep.Execute(Context context)
at BizUnit.BizUnit.ExecuteXamlTestStep(TestStepBase testStep, TestStage stage) in c:\Affinus\Depot\BizUnit\BizUnit4.0\Main\Dev\Src\BizUnit\BizUnit.cs:line 1122


If I comment out the for loop then the test works fine.

Can you think what may be causing this please?

Thanks,

Rob.
Dec 14, 2015 at 3:14 PM
Hi Rob, i have to disappoint you here - TransMock has been designed primarily for functional testing. The reason for this decision is derived by the fact that it will give little value to do performance testing of your integrations with the mock adapter. Usually it is much more interesting to see the complete picture of how a solution behaves end to end with the actual transports in place. This is because one will get more realistic picture of what the different transport specific adapter latencies would be. If you do it with the mock adapter you will get false indications - perhaps the adapter performs much better, or worse for that matter, than the actual adapter.
Another fundamental principal of performance testing is that the environment setup where the solution would be tested should be as close to production as possible. Hence it will be difficult to re-create the exact same behavior if you try to run the performance test on you single dev box. That is one of the reasons why performance related issues are often reveled in production - it is very difficult to re-create the exact same conditions during your test runs.
Furthermore - performance testing is usually performed later in the life cycle, if performed at all, and one of the pre-requisites is that the solution behaves as expected. So here lies the power of TransMock - by using it already during the development stage, one will get faster to the performance testing stage with this pre-requisite fulfilled. Perhaps this will lead to more people actually including performance testing as part of their test cycles, as there will actually be time for it :)
Jul 19, 2016 at 2:33 PM
Hi Svet, Thanks for your reply. I agree, realistic performance testing is very difficult to achieve and it's not what Transmock aims to assist with.

I've just begun a new project for which Transmock will help and I'm very pleased to see that you are continuing to develop and support - it really is an excellent framework that will help improve quality in almost every BizTalk based project.

Thanks,

Rob.