0
votes

Before sending my scenarii to our Jenkins/Gatling instance I would like to validate them on my laptop where I write them. Actually I run gatling locally and stop it as soon as it starts, but this is not optimal and I look for a solution to check them with scalac as Gatling does not have a check option. But when running scalac on scenario I always have

Homepage.scala:1: error: object duration is not a member of package concurrent import scala.concurrent.duration._

How do you validate your scenario, can someone helps me using scalac ?

Thanks !

1
That's weird. Are you using an old version of scala? I'm pretty sure scala.concurrent.duration is in the standard library. Maybe you have another package called scala? In that case you can use an absolute import, _root_.scala.concurrent.duration._. - lmm
Post your code. Otherwise, we're just guessing - The Archetypal Paul
At this point, the only sane explanation is that you're running Scala 2.9 or older. - Stephane Landelle
scala version 2.9.2 under debian wheezy - Rodolphe
Posting complete answer below, then. - Stephane Landelle

1 Answers

1
votes

Scala version numbering uses the following rule: "Epoch"."Major"."Minor"."Fix".

Major versions, that happen every 2 year or so, are not binary compatible, meaning that you can't run a code compiled with a 2.11 compiler with a 2.10 runtime and vice-versa.

Here, you're trying to use the scala.concurrent.duration package that was introduced in Scala 2.10, but you're running with 2.9. Obviously, this package doesn't exist in this version, and that's exactly what the compiler tells you.

  • If you're running Gatling 1.X (EOL'ed), you have to use Scala 2.9.
  • If you're running Gatling 2.0.X, you have to use Scala 2.10.
  • If you're running Gatling 2.1.X, you have to use Scala 2.11.