Skip to content

Simulation blocked when more than 7 scenarios #34

Open
tpitz opened this issue May 26, 2021 · 3 comments
Open

Simulation blocked when more than 7 scenarios #34

tpitz opened this issue May 26, 2021 · 3 comments

Comments

@tpitz
Copy link

tpitz commented May 26, 2021

Hello,

I'm trying to execute a Simulation which contains 13 scenarios.
Firstly, I executed the test with 2 simulations, and everything worked as expected, but as soon as I tried to merge the 2 simulations into one, gatling won't start the test.
When I try to launch up to 7 scenarios in the setUp(), it works.
As soon as I put an 8th scenario in the setUp(), gatling stays pending and the simulation never starts.
No logs are written, even if DEBUG mode is enabled in logback.xml

I have to kill the process to make it end.

Below some informations about the code:

setUp(
    scnUpdateOMSSendToWorkingOrder.inject(constantUsersPerSec(1) during (60)),
    scnIncorrectOMSSendToOrcDeadletter.inject(constantUsersPerSec(1) during (60)),
    scnOMSWithoutPrepItemSendToWorkingOrder.inject(constantUsersPerSec(1) during (60)),
    scnOMSWithPrepItemSendToWorkingOrder.inject(constantUsersPerSec(1) during (60)),
    scnTryToSendMailWithoutFSID.inject(constantUsersPerSec(1) during (60)),
    scnReceivedSPLSendConfirmMail.inject(constantUsersPerSec(1) during (60)),
    scnSPLCancelMail.inject(constantUsersPerSec(1) during (60)),
    scnMetiSplClkOrderSendToMetiOMS.inject(constantUsersPerSec(1) during (60)),
    scnMetiSplClkOrderSendToMetiOMSWithDiscount.inject(constantUsersPerSec(1) during (60)),
    scnMetiRF604Cancel.inject(constantUsersPerSec(1) during (60)),
    scnMetiRF604Ready.inject(constantUsersPerSec(1) during (60)),
    scnMetiRF604Prepared.inject(constantUsersPerSec(1) during (60)),
    scnMetiRF604IncorrectToDLQ.inject(constantUsersPerSec(1) during (60))
  ).protocols(amqpConf)
    .assertions(
      forAll.successfulRequests.percent.gt(90),
      forAll.responseTime.percentile3.lte(200)
    )

All these scenarios are base on the function below:

def omsScenario(scenarioName: String, exchangeName: String, routeKey: String, replyQueue: String, action: String, filePathMessage: String): ScenarioBuilder = {
val scnMeti: ScenarioBuilder = scenario(scenarioName)
      .feed(correlationIds)
      .exec(
        amqp(scenarioName).requestReply
          .directExchange(exchangeName, routeKey)
          .replyExchange(replyQueue)
          .bytesMessage(RawFileBody(filePathMessage))
          .contentType("application/json")
          .headers("action" -> action, "correlationId" -> "${correlationId}")
          .priority(0)
      )
    scnMeti
  }

Here is the connection configuration:

val amqpConf: AmqpProtocolBuilder = amqp
    .connectionFactory(
      rabbitmq
        .host("my_endpoint")
        .port(5672)
        .username("user")
        .password("pw")
        .vhost("/my_vhost")
    )
    .usePersistentDeliveryMode
    .replyTimeout(900000)
    .matchByMessage(getMatcher)

Any help would be great. Thank you in advance.

Terry

@ehmkah
Copy link
Contributor

ehmkah commented May 28, 2021

Some thoughts:

  • Could you please post your getMatcher method? maybe there is something strange.
  • Is the order in which you add scenarios is relevant?
  • Do you see something happening int the queue (RabbitMQ Managament GUI)?
  • Are you able to reproduce this behavior with a small example project which you could share?

@tpitz
Copy link
Author

tpitz commented May 31, 2021

  1. Here is the method:
def getMatcher(message: AmqpProtocolMessage): String = {
    message.amqpProperties.getHeaders.get("correlationId").toString
  }
  1. The order is not important. I notice it's not executed when it exceeds 7 scenarios only. When I split the scenarios into 2 separate simulation classes, it works ! The two simulations are executed sequentially, but this is not what I want. I want them to be grouped in the same report.
  2. No activty at all in the queues !
  3. You will find a repo here: https://github.com/tpitz/rabbit_one_simulation
    To make this work you will need to provide a local rabbitMQ environment.
    The image I use is: https://hub.docker.com/_/rabbitmq with tag: rabbitmq:3-management

Let me know if you encounter problems making it work locally.
Thank you in advance for your help.

@tpitz
Copy link
Author

tpitz commented Jun 16, 2021

Hi, did you take a look for a possible solution ? :)

Thank you in advance

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants