Migration from 3.9.4 to 3.10.5 and compilation error

Hi,
I’m trying to upgrade from 3.9.4 to 3.10.5 and get compilation failure in an old scala code.

I will try to describe in a short exemple

The code complaining is here :

def trackRequest(sessionParam: String, maxDuration: FiniteDuration = 3.minutes): ChainBuilder = {
 exec((ctx: ScenarioContext, next: Action) => TrackProgress(sessionParam, ctx.coreComponents.statsEngine, next))
}

The TrackProgress trait is as follow (simplified) :

private case class TrackProgress(sessionParam: String, statsEngine: StatsEngine, next: Action) extends ChainableAction with NameGen {

    override def name: String = genName(getClass.getName)

    override def execute(session: Session): Unit = {
 //do some complexe stuff here but compilation is ok
   next
    }
  }

The compilation error code is as follow :

[ERROR] HandledProgrammationEventWatcher.scala:65: overloaded method exec with alternatives:
  (execs: Iterable[io.gatling.core.action.builder.Executable])io.gatling.core.structure.ChainBuilder <and>
  (head: io.gatling.core.action.builder.Executable,tail: io.gatling.core.action.builder.Executable*)io.gatling.core.structure.ChainBuilder <and>
  (sessionFunction: io.gatling.core.session.Expression[io.gatling.core.session.Session])io.gatling.core.structure.ChainBuilder
 cannot be applied to ((io.gatling.core.structure.ScenarioContext, io.gatling.core.action.Action) => HandledProgrammationEventWatcher.this.TrackProgress)
[ERROR] one error found

I see that chainbleaction et exec trait code has changed but cannot make it compile.
I need to stand with scala code from now

Thank you in advance if you can propose input to dig

Hi,

This is custom code, not standard Gatling API usage.
Is this code open-source?

Well, it is developped for a company, but I can share it if needed, the code cheks in a list of kafka messages if one has been consumed and marks the wait time and processed time in the statsEngine in order to have those times processed by the Gatling report.
We use Gatling this 8 years, this code is legacy code, i’ll probably rework it in Java, but thought to be up to date with Gatling version before starting this kind of refacto

I see that chainbleaction et exec trait code has changed but cannot make it compile.

Here’s the file that contains the Action hierarchy: gatling/gatling-core/src/main/scala/io/gatling/core/action/Action.scala at main · gatling/gatling · GitHub

You can check on GitHub the diff between the 2 tags you’re using.

I’m afraid we can’t directly help with a Gatling private extension without a consulting contract.

Regards