Forum Discussion

milano's avatar
milano
Occasional Contributor
13 years ago

TestStep receiving message before it is active

Hello,

I have spent days trying to figure out this one, but it definitely requires the knowledge of the inner workings of SOAPUI which I don't have. So I'm asking for help if anyone can offer some:

I have an application with two threads (T1 and T2) running independently and talking to two mock services (MS1 and MS2). MS1 is always polled, which seems to be in the essence of the problem. The whole test project is relatively large, and the problem doesn't happen always and at the same point (resembling perhaps some timing issue), but I was able to reproduce it almost always in a simple test case. It runs as follows (abstracted):

1. T1 polls MS1
2. T2 sends to MS2
3. T1 polls MS1
... etc

What happens is that while SOAP UI is waiting in the activated TestStep2 for the message from T2, T1 runs its regular one-second iteration and polls MS1. Now, I would expect that call to fail since TestStep3 is not active, but surprisingly it succeeds (and I can see the message in the opened step editor, and the proper response is returned to the application - so it is certain that it succeeds)

Then TestStep2 is completed and SOAPUI goes on and activates TestStep3. Then it waits for ever there since my application (T1) has already done that one and doesn't try again.

Now, it definitelly doesn't seem right that the TestStep3 should be executed even though it is not active, but I would be happy if there is a different way to structure these tests, so that polls of MS1 at the wrong time (meaning "no data available") are handled differently than by simple failure as I do it now. So if there is a better way please suggest.

Thank you very much

Milan

4 Replies

  • milano's avatar
    milano
    Occasional Contributor
    Hi,

    I've got some more insights and now I would really like if someone from support could take a look at this. I'm beginning to understand how this works and why there is a problem:

    A) It seems that any response test step (waiting for a request and returning a response) is available and visible as soon as there are no other not-executed test steps involving the same service before it. Meaning:

    1. Step 1, Mock Service 1, Operation 1,
    2. Step 2, 3, .... n : Any number of steps involving services other than MS1
    n+1. Step n+1: Mock Service 1, Operation 2 (or Op1 or any Op) (response step)

    As soon as Step 1 has completed, Step n+1 is visible and accessible even while not activated. That is, at any moment before the activation of Step n+1, if called, it will execute and respond properly. Note that if MS1,Op2 is called before or during Step 1, the Step n+1 will not react in any way.

    B) When the Step n+1 is activated, the existing request received just a bit ago is cleared, and the step is reset and readied for execution. Then it executes as if nothing happened, and waits for invocation of MS1, Op2. However, in my case, the invocation never comes as it has been already done before the step activation.

    So, it seems to me that:

    1. The test step should not be responsive until it is activated.
    or
    2. If there is some reason for it to be responsive before activation, it shouldn't clean and ignore the already received message.

    Any comments are very appreciated.

    Milan
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi Milan,

    thanks for this, I'll see if I can figure this out..

    did you try setting the Start Step property of TS3 to itself?

    regards,

    /Ole
    eviware.com
  • milano's avatar
    milano
    Occasional Contributor
    Hi Ole,

    thanks for the reply. I haven't tried setting the StartStep property. I will in the following days for sure. Will let you know, what I find.

    Cheers

    Milan
  • milano's avatar
    milano
    Occasional Contributor
    Hello Ole,

    I tried it (StartStep), but it didn't seem to have helped.
    I just did one test with a number of messages running back and forth quickly; I did not do more testing to figure out whether something has actually changed or not.

    Cheers

    Milan