Gatling doesn't read response body from some servers

Hi.

I use quite ordinary scenario:

.exec(http(“request”)
.post("/")
.body(StringBody("${request}"))
.check(status.is(session => 200))
.check(bodyString.saveAs(“Http_Response”))
)

On some servers gatling reads full response, but on some the
bodyString is empty(0 length). The requests are the same
and I tried with curl both servers and got responses from
every server. What could be the reason for this kind of behavior.

Thanks in advance
Ivar Suisalu

It means the requests are not the same. Try spotting differences, in particular in HTTP headers.

Hi.

The requests are read from csv feeder and headers are defined in the beginning of the scenario:

val httpProtocol = http
.disableCaching
.baseUrl(configSource.getString(“simulation.serverUrl”)) // Here is the root for all relative URLs
.header(“Content-Type”, “application/xml”)
.header(“Expect”, “100-continue”)
.acceptHeader("/")

So I think the requests are the same.

Ivar

I debugged gatling and noticed that in problematic case
the first response headers were:

Transfer-Encoding → chunked
Vary → Accept-Encoding
{AsciiString@5844} “content-encoding” → gzip

so the response is chunked and gzipped.
Response from successful server wasn’t chunked.
So it has something to do with processing chunked
response.

Ivar

Please provide a way to reproduce your issue.

Hi.

It is hard to provide testcase. I constructed with nginx and perl one mocking server, but this worked correctly.
What I noticed during debugging with problematic server, that gatling does link prefetch and after that
server responds Content-Length: 0 and this ends the conversation.