Some simulation files not appearing in the selection menu on running gatling.sh

Hello,

I am facing this issue where intermittently some of my simulation files are not appearing in the selection menu on running gatling.sh, even though they are present in user_files/simulations

kishankumar:/opt/software/old_gatling-charts-highcharts-bundle-2.1.7/bin$ sudo sh gatling.sh

GATLING_HOME is set to /opt/software/old_gatling-charts-highcharts-bundle-2.1.7
Choose a simulation number:
[0] computerdatabase.BasicSimulation
[1] computerdatabase.advanced.AdvancedSimulationStep01
[2] computerdatabase.advanced.AdvancedSimulationStep02
[3] computerdatabase.advanced.AdvancedSimulationStep03
[4] computerdatabase.advanced.AdvancedSimulationStep04
[5] computerdatabase.advanced.AdvancedSimulationStep05
[6] gamma1.UAT1oct27HomePageNoStaticResources
[7] gamma1.UAT1oct27HomePageNoStaticResourcesWL
[8] gamma1.UAT49HomePageNoStaticResources
[9] gamma1.UAT49HomePageNoStaticResourcesWL
[10] gamma1.gammaCarLoanFullFlowNoStaticResources
[11] gamma1.gammaHomePageNoStaticResourcesWL
[12] prod111.gammaTest1
[13] prod111.prodTest1
[14] prod111.prodTest1Dup
[15] prod111.prodtempTest1
[16] prod111.testProd111111
[17] prod111.testProd123
[18] prod111.testProdHomePage

I am using Gatling on Ubuntu & am using HAR method to get the recording and am able to generate scala simulation files out of them using Gatling recorder.
I tried with the latest snapshots of both the Gatling versions 2.1.7 & 2.2.0.

Please find attached couple of .har & .scala files for reference.

There is one more issue, where I am hitting “MissingResourceException Issue in getting Date Pattern
java.util.MissingResourceException: Can’t find resource for bundle java.util.PropertyResourceBundle, key date.format”.
This same issue is not seen during normal browsing but seen only when I do the HAR recording & run the scala simulation using Gatling.

Below is the formParam for the corresponding HTTP request from the scala file:
.formParam(“timestamp”, “1445947913855”)

Any clue in this regard would be highly appreciated.

Thanks & Regards,

Kishan Kumar

gamma1_Oct20_HomePage.har (1.48 MB)

prod_oct20_home_page.har (1.41 MB)

gammaOct20HomePageNoStaticResourcesWL.scala (1.01 KB)

prodOct20HomePageNoStaticResourcesWhitelist.scala (866 Bytes)

Can anyone please throw some light on what could be causing this issue & how we can fix this ?

Thanks,
Kishan.

Can’t reproduce.
Please provide a zip with your full install.

Hello Stephane,

Thanks for the response.
Please find attached the required zipped folder.
I have removed the lib.
I had installed gatling 2.1.7 from Gatling - Professional Load Testing Tool.
I see the target/test-files is not getting populated with the simulation files.
Even manually giving the file path is not working somtimes for some HARs.
sh gatling.sh -sf …/user-files/simulations/localHost -s localOct29CLNSRExternalCodeChange6.scala.

Thanks,
Kishan.

dup_old_gatling-charts-highcharts-bundle-2.1.7.tar.gz (524 KB)

Hi Stephane,

Could you please help check the issue? I have attached the files in my previous mail.

Thanks,
Kishan.

I couldn’t reproduce with what you provided, that’s why I asked for a full zip of your gatling install w/ simulations.

Hello Stephane,

Thanks for the response.
Please find attached the required zipped folder.
I have removed the lib.
I had installed gatling 2.1.7 from http://gatling.io/#/download.
I see the target/test-files is not getting populated with the simulation files.
Even manually giving the file path is not working somtimes for some HARs.
sh gatling.sh -sf …/user-files/simulations/localHost -s localOct29CLNSRExternalCodeChange6.scala.

There is one more issue, where I am hitting “MissingResourceException Issue in getting Date Pattern
java.util.MissingResourceException: Can’t find resource for bundle java.util.PropertyResourceBundle, key date.format”.
This same issue is not seen during normal browsing but seen only when I do the HAR recording & run the scala simulation using Gatling.

Below is the formParam for the corresponding HTTP request from the scala file:
.formParam(“timestamp”, “1445947913855”)

Also I was facing some Java version issue on using latest Gatling 2.2.0 snapshot.
Does Gatling 2.2.0 doesn’t work with Java 7. Any configuration changes needed for that ?

Thanks,

Kishan.

dup_old_gatling-charts-highcharts-bundle-2.1.7.tar.gz (524 KB)

Hi Stephane,

Gmail is not allowing exe files to be attached in zipped folder.
So my previous attachment mail is not showing up in gmail.
However you can check the same at gatling google group.
I have reposted with the attachment in the google group.
Please find the post at https://groups.google.com/forum/#!topic/gatling/iPQAcxXTpus
Please let me know if you face any issue or any more file needs to be attached.

Thanks,
Kishan.

Hi Kishan,

Several things in there.

First, Gatling 2.1.7 doesn’t properly report compiler crashes (that could be triggered by compile errors, which are reported separately, directly by the compiler). This is fixed in https://github.com/gatling/gatling/issues/2840

Then, Scala compiler 2.11.7 doesn’t properly reports your error. This is fixed in https://github.com/scala/scala-asm/issues/8 but hasn’t been shipped in a Scala release yet.

Finally, regarding your actual compile error, with the above mentioned fix, you’d get:
“Could not write class localHost/localOct29CLNSRExternalCodeChange4 because it exceeds JVM code size limits. Method 's code too large!”

Gatling simulations are Scala classes, and all your code is actually placed in the constructor. As you kept on adding new code in there, you ended up with a 2700 lines constructor, that blows up Java bytecode maximum method length.

You should refactor, as described in our advanced tutorial. There’s no way you can maintain such long method anyway.

Regards,

Hi Stephane,

Thanks for your detailed response.
But I am getting this issue even with small scala files.
Had got large file issue with some scala files and then reduced their size.
Will try to bring down the size of my other long scala files as well.
So what I understand is that even if there is a single large scala file in the simulations folder, the compilation may fail silently & simulations may not appear.
And there is no limit on the number of simulation files and their overall size.
Is that right?

I will give a try with latest Gatling 2.2.0 snapshot & get back if I face any issue.

Hi Kishan

Just a suggestion, but have you tried running your simulations from SBT instead of a batch file? I promise you, it’ll make life easier.

Here is an example project: https://github.com/gatling/gatling-sbt-plugin-demo

Aidy

Thanks Aidy for your suggestion. Will give that a try.

Hi Stephane,

After moving to latest Gatling version 2.2.0 & JAVA8, I am able to proceed.
I am facing an issue though which I was not facing earlier.
The form parameters with empty value are getting generated without double quotes now, example .formParam(“isPartner”, ) instead of .formParam(“isPartner”, “”), leading to compilation issue. As a workaround I need to manually add double quotes to all such parameters.
Having lots of form parameters makes it difficult to manually add double quotes to all such parameters in the scala file.
Is this a known issue in the latest version? Is there any other workaround?

Thanks,
Kishan.

Fixed

Hi Stephane,

Could you please let me know if this is a known issue?

The form parameters with empty value are getting generated without double quotes now, example .formParam(“isPartner”, ) instead of .formParam(“isPartner”, “”), leading to compilation issue. As a workaround I need to manually add double quotes to all such parameters.
Having lots of form parameters makes it difficult to manually add double quotes to all such parameters in the scala file.
Is this a known issue in the latest version? Is there any other workaround?

Thanks,
Kishan.

Hi Stephane,

I seem to be facing the same problem. I have removed the big files still they are showing in the menu. Could you please help me with this?
PFA screenshots for reference.
Also, I have a few more questions.

  • Does the menu show only those simulations which are there in the simulation folder? Because in my case, simulations sim1 and sim2 are not in that folder and are still showing in the menu.
  • Can you please tell me how to correlate a session id which is in the cookie and is also being passed later in the request.

Thanks,
Nupur

gatling 1.PNG

Hi Stephane,

Facing one more error.

  • Facing the issue where I am making changes in the .scala file due to which some errors that were coming earlier should go but those changes are not reflected when I run the simulation i.e. the same error is coming again.

The error was of check statement
There was an recorded check statement which checked that the http status was 304. But the actual http status that was coming was 200. So I changed this check statement so that it didnt throw an error

Earlier the check statement was
.check(status.is(304))

Now I changed it to
.check(status.in(200,304))

But when I run the simulation the error is still coming that expected status is 304 and actual is 200.
The above change does not seem to be throwing a compilation error also.

Please give a solution for this.