Strange behavior when logging is off in Gatling 2.1.7

Hi there,
during the development of my stress tests logging was set to on and everything worked well. Trying to run the tests with logging off, i get errors.
I tried again with logging off → no errors, logging on → errors.

I finally identified the cause: a type conversion error

replacing

val incidentMap = session(“incidentMap”).as[Map[String, Any]]
val listBuffer = new scala.collection.mutable.ListBufferString
for (entry ← incidentMap.get(“alerts”).get.asInstanceOf[org.boon.core.value.ValueList].list()) {
listBuffer += entry.asInstanceOf[String]
}

with

val incidentMap = session(“incidentMap”).as[Map[String, Any]]

val listBuffer = new scala.collection.mutable.ListBufferString

for (entry ← incidentMap.get(“alerts”).get.asInstanceOf[org.boon.core.value.ValueList].list()) {

listBuffer += (entry.toString)

}

the error is gone. But why does the error occur only with logging off

We use Boon’s lazy loading Maps, so there’s a chance you’re displaying them in some way in debug logging level, forcing them to load.

Hello Stéphane,
the technical problem is already solved. What scares me is, that Gatling shows a different behavior in dependence of logging on or off.

– Ulrich

I would love a reproducer.
I really suspect you’re scanning the JSON tree an additional first time when debugging.
I wonder if we should deep copy branches when using ofType.