0

I created a Gatling simulation script that first executes some requests that were generated by the recorder. After this, it executes a custom action which starts another thread, since there are blocking methods involved.

My problem now is the fact that the simulation does not terminate. Even though the requests are executed exactly once in the beginning, I keep getting status reports saying that there is one active user. Also if I add more requests after the custom action, they won't be executed.

How can I fix this?

Edit

This is my custom action:

class RegisterAction extends Action {

  override def execute(session: Session): Unit = CustomInboxRunner.startInboxRunner("usermail", "pw")

  override def name: String = "RegisterAction"
}

This is the relevant extract from the simulation script:

object ClickConfirmationLink {
  val action = new ActionBuilder {
    override def build(ctx: ScenarioContext, next: Action): Action = new RegisterAction
  }
  val pause = new PauseBuilder(1000 millis, None)
  val confirm = new ChainBuilder(List(action, pause))
}

val scn = scenario("UserRegistration").exec(Register.register, ClickConfirmationLink.confirm)

setUp(scn.inject(atOnceUsers(1))).protocols(httpProtocol)

CustomInboxRunner.startInboxRunner(...) is a Java method that starts a new thread.

Jeffrey Chung
  • 19,319
  • 8
  • 34
  • 54
maresac
  • 21
  • 6
  • Please share some code. It would be difficult to understand the issue without looking at the code. – Avinash Anand May 04 '18 at 08:42
  • Do I maybe have to extend another class than `Action`? I added the `pause` after my custom action, since it is an exitable action. Any help would be appreciated. – maresac May 10 '18 at 09:39
  • I guess it is because you don't call `next.execute(session)` – rashtao Jun 25 '18 at 12:27

0 Answers0