random feeder from CSV randomly causes empty values

I’m sending a xml request body using ssp template that contains:

<tns:user ssn="${user_ssn}" otsId="${user_otsid}"/>

I feed it with csv file that contains:

user_ssn,user_otsid
123456,349834
234234,234234

and so on.

Simulation goes like:

val scn = scenario(“Scenario name”).loop(chain
.feed(csv(“itella_user_info.csv”).random)
.exec(http(“request_0”)
.post("/persistEvent")
.headers(headers_0).check(status.is(200))
.fileBody(“event_feeder_template1”, Map(“user_ssn” → “${user_ssn}”, “user_otsid” → “${user_otsid}”))
.check(regex(""“OK”"").exists)
)
.pause(0,30,MILLISECONDS))
.times(4)

Now, most requests go through fine, but some of them cause a validation error that complains that either user_ssn or user_otsid is empty. What could be the reason for this?

Thanks,

–janne

Ok, I also get one instance of:

[INFO] 09:13:12.147 [GatlingSystem-akka.actor.default-dispatcher-10][WARN ] c.e.e.g.c.u.StringHelper$ - Couldn’t resolve session attribute user_otsid

in the beginning of the simulation.

–janne

torstai, 31. toukokuuta 2012 9.27.08 UTC+3 Janne Sinivirta kirjoitti:

hmm… same thing happens with “circular”, so it’s not the random strategy. I get random amount of:

[INFO] 09:13:12.147 [GatlingSystem-akka.actor.
default-dispatcher-10][WARN ] c.e.e.g.c.u.StringHelper$ - Couldn’t resolve session attribute user_otsid

these.

torstai, 31. toukokuuta 2012 9.27.08 UTC+3 Janne Sinivirta kirjoitti:

Hi Janne,

Which version of Gatling do you use?
How do you launch it (cli, maven project, maven plugin)?
Is your file located in the data directory?

Cheers,

Steph

2012/5/31 Janne Sinivirta <janne.sinivirta@gmail.com>

Gatling version 1.1.6.
Run it with maven plugin, project is directly based on the example project from github.
File is located in the data directory.

–janne

torstai, 31. toukokuuta 2012 10.07.29 UTC+3 Stéphane Landelle kirjoitti:

OK, I’ll have a look at it ASAP. If there’s indeed a problem, I want it fixed before releasing 1.2.0 today.

BTW:

2012/5/31 Janne Sinivirta <janne.sinivirta@gmail.com>

Actually, regarding the second point, I’ll make it work as you wrote it for 1.2.0.

2012/5/31 Stéphane Landelle <slandelle@excilys.com>

By any chance, would you happen to have an empty line at your csv file?

2012/5/31 Stéphane Landelle <slandelle@excilys.com>

I’ve pushed a fix for filtering empty lines in csv files:
https://github.com/excilys/gatling/issues/534

Could you please confirm that you have this kind of empty lines in your file, even as the last one?

Cheers,

Stephane

2012/5/31 Stéphane Landelle <slandelle@excilys.com>

We’ve just released 1.2.0.
If your problem was indeed an empty line, you should check it out! Well, you should check it out anyway… :wink:

Cheers,

Stephane

2012/5/31 Stéphane Landelle <slandelle@excilys.com>

Thanks for you fast help and fixes. I didn’t have empty lines in csv (that was my first guess too and I had one lonely return at the end originally but fixed that).

Whatever it was, the script now works beautifully on 1.2.0.

Thank you for an excellent tool (and giving me a nice excuse to finally write Scala at work).

Few little things: Check being varargs should probably be mentioned in the advanced tutorial. Access to API docs should be available from the right side quick links, now I just find it from the front page (I could be blind too :).

Thanks,

–janne

torstai, 31. toukokuuta 2012 17.11.20 UTC+3 Stéphane Landelle kirjoitti:

Hi Janne,

Glad to hear. For the record, the one lonely return at the end was indeed a problem as opencsv interpret it as a record with one empty field.
I’ll have a look at the doc, too.

Have fun with Gatling and Scala,

Steph

2012/6/1 Janne Sinivirta <janne.sinivirta@gmail.com>