Disappearing response body

In my setup I have a responseInfoExtractor that includes the response body into the simulation log (yes, I’m aware of the performance implications).

The problem I’m facing is that when I check the response body for some JSON path, it is suddenly empty in the log. If I remove the JSON path checks, the body will appear again in the logs.

Is this a bug or normal behavior?

Thanks in advance for any answers and for a great tool!

Yes, this is normal behavior: see disableResponseChunksDiscarding
https://github.com/excilys/gatling/wiki/HTTP#wiki-custom-dump

Cheers,

Stéphane

Just did some more tests and it seems it’s a bug. It was working correctly in 1.4.3 but is broken after that.

I have disabled the response chunks discarding and do get some data in my simulation log. It’s just that the response body is empty after trying to parse JSON from it. This occurs since 1.4.4; before that, everything was fine.

Damn, I fear I know what happens…
I made some optimizations so that some checks can directly read from the underlying ByteBuffer and I’m afraid it can only be read once.
Let me check.

Fixed. As I suspected, I shouldn’t have been using Response.getResponseBodyAsStream: it streams directly from the underlying ChannelBuffer and consumes it.
Thanks for your help.

Thank you for fixing it so quickly… And keep up the good work!

You’re welcome. I’ll build a snapshot as soon as we get our Cloudbees FOOS monthly credits renewed…
https://gatling.ci.cloudbees.com