oysteigi
14 years agoOccasional Contributor
MockResponse too slow
I'm trying to test a choreography module by triggering it in step 1 (test request) and mock the calls made by the module in the following steps by using mock response. I can set this up very easily. For example, if my CompleteOrder module did ShipOrder and SendInvoice, I would make test steps like:
1. TestRequest CompleteOrder
2. MockResponse ShipOrder
3. MockResponse SendInvoice
The problem is that once I call CompleteOrder, sometimes my module ships the order and sends the invoice before the MockService is up and running. The delay between step 2 and 3 is about 500ms, probably waiting for the MockService to stop and start. This makes the test very fragile, because it only succeeds if the choreography takes a certain time to do the ShipOrder and SendInvoice calls.
Did anyone else run into this already? Is there an easy solution? Would it be possible to keep the MockService running all the time (block between steps) or lower the latency between steps?
1. TestRequest CompleteOrder
2. MockResponse ShipOrder
3. MockResponse SendInvoice
The problem is that once I call CompleteOrder, sometimes my module ships the order and sends the invoice before the MockService is up and running. The delay between step 2 and 3 is about 500ms, probably waiting for the MockService to stop and start. This makes the test very fragile, because it only succeeds if the choreography takes a certain time to do the ShipOrder and SendInvoice calls.
Did anyone else run into this already? Is there an easy solution? Would it be possible to keep the MockService running all the time (block between steps) or lower the latency between steps?