Injecting 0 users in scenario message during rampup users in gatling

余生长醉 提交于 2020-01-16 06:21:07

问题


I am using a simple setup to ramp up the users but getting the following error and the run is going on infinite loop

code in my Scenario:

setUp(
    scenarioBuilder.inject(
      rampUsers(numUser).during(duration minutes)
    )
  ).protocols(protocolBuilder)

Error message which goes infinite loop:

09:35:46.495 [GatlingSystem-akka.actor.default-dispatcher-2] DEBUG io.gatling.core.controller.inject.open.OpenWorkload - Injecting 0 users in scenario xxSimulation, continue=true
09:35:47.494 [GatlingSystem-akka.actor.default-dispatcher-6] DEBUG io.gatling.core.controller.inject.open.OpenWorkload - Injecting 0 users in scenario xxSimulation, continue=true
09:35:48.495 [GatlingSystem-akka.actor.default-dispatcher-6] DEBUG io.gatling.core.controller.inject.open.OpenWorkload - Injecting 0 users in scenario xxSimulation, continue=true
09:35:49.495 [GatlingSystem-akka.actor.default-dispatcher-2] DEBUG io.gatling.core.controller.inject.open.OpenWorkload - Injecting 0 users in scenario xxSimulation, continue=true
09:35:50.495 [GatlingSystem-akka.actor.default-dispatcher-6] DEBUG io.gatling.core.controller.inject.open.OpenWorkload - Injecting 0 users in scenario xxSimulation, continue=true

numUser = 2 duration = 1

this is not working only for rampUsers.. if I change it to rampConcurrentUsers or atOnceUsers its working fine. I also debugged with trace setting.. and found that the header response for the payload is returning 200 OK

x-request-id: TEST|K0P632HL|B6W2BJXR
Authorization: Bearer xxx
accept: */*
cookie: xxLB_SIRG=xx
host: xx.com, content=null}
09:35:42.832 [gatling-http-1-2] DEBUG io.gatling.http.client.impl.HttpAppHandler - Read msg='DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)
HTTP/1.1 200 OK
cache-control: no-cache
Date: Wed, 11 Dec 2019 17:35:42 GMT
Content-Type: application/json; charset=UTF-8
Content-Length: 3390
Strict-Transport-Security: max-age=15638400; includeSubDomains'
09:35:42.833 [gatling-http-1-2] DEBUG 

Simultion File added as per request:

package com.xx.project

import com.xx.project.TestClientBase._
import io.gatling.core.Predef._
import io.gatling.core.structure.{ChainBuilder, ScenarioBuilder}
import io.gatling.http.Predef.http
import io.gatling.http.protocol.HttpProtocolBuilder

import scala.concurrent.duration._

abstract class Comparison(otherType: String, graphql: ChainBuilder, other: ChainBuilder)
  extends Simulation
    with PerformanceBase {

  def loopCount: Int = numRequests

  def getClientRequestId(): String = {
    val sb = new StringBuilder
    val chars = ('A' to 'Z') ++ ('0' to '9')
    for (i <- 1 to 8) {
      val randomNum = util.Random.nextInt(36)
      sb.append(chars(randomNum))
    }
    sb.toString
  }

  def protocolBuilder: HttpProtocolBuilder = {
    http
      .baseUrl(baseUrl)
      .header("x-request-id","TEST|" + getClientRequestId() + "|" + getClientRequestId())
      .authorizationHeader(s"Bearer ${token.value}")
  }

  val scenarioBuilder: ScenarioBuilder =
    scenario(this.getClass.getSimpleName)
      .exec(
        repeat(loopCount, "i") {
          group("graphql") {
            graphql
          }
        }
        ,
        repeat(loopCount, "i") {
          group(otherType) {
            other
          }
        }
      )

  setUp(
    scenarioBuilder.inject(
      rampUsers(numUser).during(duration minutes)
    )
  ).protocols(protocolBuilder)

}

Please help to resolve this issue

来源:https://stackoverflow.com/questions/59295429/injecting-0-users-in-scenario-message-during-rampup-users-in-gatling

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!