加特林:测试目标似乎编译了两次

问题描述 投票:0回答:1

我想使用Gatling从JupyterLab进行负载测试。我已经按照Gatling网站上的说明进行了所有设置:我有maven,scala和gatling-maven-plugin。但是,在设置pom.xml之后,每次我运行命令:mvn gatling:test时,都会收到一条错误消息,指出我的模拟类“ BasicSimulation”已经定义。看起来它正在被编译两次。

我试图重新创建整个项目。我尝试了“禁用编译器”标志。我没有使用Maven编译器作为插件,也没有使用。我尝试过改变插件的顺序。

我正在使用的实际代码,来自https://gatling.io/docs/current/quickstart


import io.gatling.core.Predef._ // 2
import io.gatling.http.Predef._
import scala.concurrent.duration._

class BasicSimulation extends Simulation { // 3

  val httpProtocol = http // 4
    .baseUrl("http://computer-database.gatling.io") // 5
    .acceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8") // 6
    .doNotTrackHeader("1")
    .acceptLanguageHeader("en-US,en;q=0.5")
    .acceptEncodingHeader("gzip, deflate")
    .userAgentHeader("Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0")

  val scn = scenario("BasicSimulation") // 7
    .exec(http("request_1") // 8
      .get("/")) // 9
    .pause(5) // 10

  setUp( // 11
    scn.inject(atOnceUsers(1)) // 12
  ).protocols(httpProtocol) // 13
}

我已将我的pom.xml文件包含在pastebin上:https://pastebin.com/siV43Skf

我认为问题就在这里。

我希望BasicSimulation能够正确运行,但是我得到我的BasicSimulation类已经定义了-即使它是整个项目中的一个文件。

scala maven gatling
1个回答
0
投票

这个问题解决了吗?如果是这样,那么根本原因是什么?我正面临类似的问题。

© www.soinside.com 2019 - 2024. All rights reserved.