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.