I’m trying to stress test our File upload API using gatling and running into some issues. It was working with Gatling 1 properly with upload parameter, but as it’s been deprecated in Gatling 2, I’m having issues in making it work. The file’s not being uploaded properly and I’m getting EOF errors on the server. It used to work fine with Gatling 1, but I need inject API functionality which is available only in Gatling 2.
Here’s my simulation and the CSV contains productId, checkSum, fileSize and fileName
I currently use 2.0.0-M3. I tried using .bodyPart(RawFileBodyPart(“data”, “${fileName}”, “application/pdf”)) and that didn’t work either. upload was used without .bodyPart with 1.5.3 and I guess upload is deprecated in Gatling 2. Sorry for the confusion
I’m getting this error with the new snapshot and your simulation
value withContentType is not a member of io.gatling.http.request.FileBodyPart
possible cause: maybe a semicolon is missing before `value withContentType’?
11:19:21.147 [ERROR] i.g.a.ZincCompiler$ - .withContentType(“application/pdf”))
11:19:21.148 [ERROR] i.g.a.ZincCompiler$ - ^
11:19:21.156 [ERROR] i.g.a.ZincCompiler$ - one error found
Compilation failed
Heap
Also, I changed it to contentType instead of withContentType for the mime type and that seems to have gone to the next step, but more errors this time about the HTTP engine
11:35:59.409 [ERROR] i.g.h.a.HttpRequestAction - Action HttpRequestAction crashed on message Some(Session(Performance Test,8083881021089530740-8,Map(productId → prd56746-3456, checkSum → 56746, fileSize → 3456, fileName → file_3370.pdf),1389123359319,0,List(),List(OK),List(),List())), forwarding user to the next one
java.lang.UnsupportedOperationException: HTTP engine hasn’t been started
at io.gatling.http.ahc.HttpEngine$.instance(HttpEngine.scala:62) ~[gatling-http-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
at io.gatling.http.action.HttpRequestAction$.send$1(HttpRequestAction.scala:54) ~[gatling-http-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
at io.gatling.http.action.HttpRequestAction$.beginHttpTransaction(HttpRequestAction.scala:65) ~[gatling-http-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
I haven’t disbaled warmUp and attached the exception in full for your reference
[ERROR] [01/07/2014 11:35:59.369] [GatlingSystem-akka.actor.default-dispatcher-6] [akka://GatlingSystem/user/$c] HTTP engine hasn’t been started
java.lang.UnsupportedOperationException: HTTP engine hasn’t been started
at io.gatling.http.ahc.HttpEngine$.instance(HttpEngine.scala:62)
at io.gatling.http.action.HttpRequestAction$.send$1(HttpRequestAction.scala:54)
at io.gatling.http.action.HttpRequestAction$.beginHttpTransaction(HttpRequestAction.scala:65)
at io.gatling.http.action.HttpRequestAction$$anonfun$executeOrFail$1$$anonfun$2.apply(HttpRequestAction.scala:109)
at io.gatling.http.action.HttpRequestAction$$anonfun$executeOrFail$1$$anonfun$2.apply(HttpRequestAction.scala:105)
at io.gatling.core.validation.Success.map(Validation.scala:29)
at io.gatling.http.action.HttpRequestAction$$anonfun$executeOrFail$1.apply(HttpRequestAction.scala:105)
at io.gatling.http.action.HttpRequestAction$$anonfun$executeOrFail$1.apply(HttpRequestAction.scala:102)
at io.gatling.core.validation.Success.flatMap(Validation.scala:30)
at io.gatling.http.action.HttpRequestAction.executeOrFail(HttpRequestAction.scala:102)
at io.gatling.core.action.Failable$class.execute(Actions.scala:70)
at io.gatling.http.action.HttpRequestAction.execute(HttpRequestAction.scala:95)
at io.gatling.core.action.Action$$anonfun$receive$1.applyOrElse(Actions.scala:30)
at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:166)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:498)
at akka.actor.ActorCell.invoke(ActorCell.scala:456)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:237)
at akka.dispatch.Mailbox.run(Mailbox.scala:219)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:386)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
11:35:59.377 [ERROR] i.g.h.a.HttpRequestAction - Action HttpRequestAction crashed on message Some(Session(Performance Test,8083881021089530740-0,Map(productId → prd56746-3456, checkSum → 56746, fileSize → 3456, fileName → file_4289.pdf),1389123359318,0,List(),List(OK),List(),List())), forwarding user to the next one
java.lang.UnsupportedOperationException: HTTP engine hasn’t been started
at io.gatling.http.ahc.HttpEngine$.instance(HttpEngine.scala:62) ~[gatling-http-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
at io.gatling.http.action.HttpRequestAction$.send$1(HttpRequestAction.scala:54) ~[gatling-http-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
at io.gatling.http.action.HttpRequestAction$.beginHttpTransaction(HttpRequestAction.scala:65) ~[gatling-http-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
at io.gatling.http.action.HttpRequestAction$$anonfun$executeOrFail$1$$anonfun$2.apply(HttpRequestAction.scala:109) ~[gatling-http-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
at io.gatling.http.action.HttpRequestAction$$anonfun$executeOrFail$1$$anonfun$2.apply(HttpRequestAction.scala:105) ~[gatling-http-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
at io.gatling.core.validation.Success.map(Validation.scala:29) ~[gatling-core-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
at io.gatling.http.action.HttpRequestAction$$anonfun$executeOrFail$1.apply(HttpRequestAction.scala:105) ~[gatling-http-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
at io.gatling.http.action.HttpRequestAction$$anonfun$executeOrFail$1.apply(HttpRequestAction.scala:102) ~[gatling-http-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
at io.gatling.core.validation.Success.flatMap(Validation.scala:30) ~[gatling-core-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
at io.gatling.http.action.HttpRequestAction.executeOrFail(HttpRequestAction.scala:102) ~[gatling-http-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
at io.gatling.core.action.Failable$class.execute(Actions.scala:70) ~[gatling-core-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
at io.gatling.http.action.HttpRequestAction.execute(HttpRequestAction.scala:95) ~[gatling-http-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
at io.gatling.core.action.Action$$anonfun$receive$1.applyOrElse(Actions.scala:30) ~[gatling-core-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:166) ~[scala-library-2.10.3.jar:na]
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:498) ~[akka-actor_2.10-2.2.3.jar:2.2.3]
at akka.actor.ActorCell.invoke(ActorCell.scala:456) ~[akka-actor_2.10-2.2.3.jar:2.2.3]
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:237) ~[akka-actor_2.10-2.2.3.jar:2.2.3]
at akka.dispatch.Mailbox.run(Mailbox.scala:219) ~[akka-actor_2.10-2.2.3.jar:2.2.3]
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:386) ~[akka-actor_2.10-2.2.3.jar:2.2.3]
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) ~[scala-library-2.10.3.jar:na]
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) ~[scala-library-2.10.3.jar:na]
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) ~[scala-library-2.10.3.jar:na]
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) ~[scala-library-2.10.3.jar:na]
OK, I think I get it.
I refactored multipart in Gatling 2, so that it can address the more general use case of multipart, and not only form upload.
The thing is with form is that browsers always send filename attribute (in Content-Disposition header) and servers usually expect it, but from a multipart perspective, this information is optional.