You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by Igor Sasovets <is...@gmail.com> on 2018/07/01 08:08:02 UTC

PR390 - update mongo-java-driver version

Hi, Team! Recently I opened PR to apache/jmeter github repository:
https://github.com/apache/jmeter/pull/390. Main aim of this PR is to allow
users apply JMeter for projects which use MongoDB database.  I wanted to
test my application that uses MongoDB database using JMeter but faced with
problems which related to mongo-java-driver version. Since MongoDB config
deprecated, I used JSR232 Sampler and wrote Java code that allows me to
interact with database. Current version of mongo-java-driver (2.11.3) is
out of date and I couldn't connect to my DB using created script. So, I
decided to update mongo-java-driver version because it allows to use JMeter
with MongoDB and has big impact to user experience (at least, for me and my
colleagues). PR build failed due to problem with version of ant.

Re: PR390 - update mongo-java-driver version

Posted by Igor Sasovets <is...@gmail.com>.
Hi, Felix! Thanks so much) I pushed chages to the pr.

Re: PR390 - update mongo-java-driver version

Posted by Felix Schumacher <fe...@internetallee.de>.

Am 5. Juli 2018 17:32:35 MESZ schrieb Igor Sasovets <is...@gmail.com>:
>Thanks for help! Maybe I push it to my fork and provide a link to these
>changes. Then you will be able to run it locally on your machine. I
>don't
>want to remove this sampler, I just updated it and removed deprecated
>functions. Now I'm trying to find failed unit test and I'm almost sure
>that
>it related to backward compatibility testing. Is it will be OK for you?
>If
>yes, please notify me and I'll add these changes.

Yes, push the changes to the pr. 

Regards, 
 Felix 

>
>Best regards,
>Igor

Re: PR390 - update mongo-java-driver version

Posted by Igor Sasovets <is...@gmail.com>.
Thanks for help! Maybe I push it to my fork and provide a link to these
changes. Then you will be able to run it locally on your machine. I don't
want to remove this sampler, I just updated it and removed deprecated
functions. Now I'm trying to find failed unit test and I'm almost sure that
it related to backward compatibility testing. Is it will be OK for you? If
yes, please notify me and I'll add these changes.

Best regards,
Igor

Re: PR390 - update mongo-java-driver version

Posted by Felix Schumacher <fe...@internetallee.de>.
Am Mittwoch, den 04.07.2018, 21:58 +0300 schrieb Igor Sasovets:
> Hi, Felix! I tried to delete mongodb sampler data and ran tests. In
> result I get 7 failed tests. So, I think that there tests somehow
> connected to the sampler (TestSaveService).
> Can you help me with this?
> 

JMeter tests for backward compatibilty with respect to
samplers/controllers/... by loading old test plans, saving them and
comparing the results.

When you remove a sampler (controller,...) you will have to modify
those test plans, as JMeter wouldn't be able to load those samplers in
the test plan any more.

You can find the ones by using "grep Mongo -r bin/testfiles".

But if we remove the sampler, we would most probably want to make it
available somewhere else as a plugin. (But I don't know yet, how to
tackle that).

Regards,
 Felix

Re: PR390 - update mongo-java-driver version

Posted by Igor Sasovets <is...@gmail.com>.
Hi, Felix! I tried to delete mongodb sampler data and ran tests. In result
I get 7 failed tests. So, I think that there tests somehow connected to the
sampler (TestSaveService).
Can you help me with this?

Re: PR390 - update mongo-java-driver version

Posted by Igor Sasovets <is...@gmail.com>.
Felix, I ran tests and now error stacktrace changed. Here is output:

..............................................................................
..............................................................................
..............................E...............................................
..............................................................................
..............................................................................
..............................................................................
......................I.....I.................................................
...................
   [java] Time: 78,453
   [java] There were 2 failures:
   [java] 1) RunTime stops within a tolerance after specified
runtime(org.apac
.jmeter.control.RunTimeSpec)
   [java] Condition not satisfied:
   [java]
   [java] elapsed <= runTimeMillis + (tolerance * samplerWaitTime)
   [java] |       |  |             |  |         | |
   [java] 1202    |  1000          |  1.0       | 200
   [java]         false            1200.0       200.0
   [java]
   [java]     at org.apache.jmeter.control.RunTimeSpec.RunTime stops within
a
lerance after specified runtime(RunTimeSpec.groovy:70)
   [java] 2) errorDetected(org.apache.jmeter.testbeans.gui.PackageTest)
   [java] junit.framework.AssertionFailedError: One or more errors detected
-
e log file
   [java]     at junit.framework.Assert.fail(Assert.java:57)
   [java]     at junit.framework.TestCase.fail(TestCase.java:227)
   [java]     at
org.apache.jmeter.testbeans.gui.PackageTest.errorDetected(Pac
geTest.java:212)
   [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   [java]     at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces
rImpl.java:62)
   [java]     at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
dAccessorImpl.java:43)
   [java]     at java.lang.reflect.Method.invoke(Method.java:498)
   [java]     at junit.framework.TestCase.runTest(TestCase.java:176)
   [java]     at
org.apache.jmeter.testbeans.gui.PackageTest.runTest(PackageTe
.java:105)
   [java]     at junit.framework.TestCase.runBare(TestCase.java:141)
   [java]     at junit.framework.TestResult$1.protect(TestResult.java:122)
   [java]     at
junit.framework.TestResult.runProtected(TestResult.java:142)
   [java]     at junit.framework.TestResult.run(TestResult.java:125)
   [java]     at junit.framework.TestCase.run(TestCase.java:129)
   [java]     at junit.framework.TestSuite.runTest(TestSuite.java:252)
   [java]     at junit.framework.TestSuite.run(TestSuite.java:247)
   [java]     at
org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38Clas
unner.java:86)
   [java]     at org.junit.runners.Suite.runChild(Suite.java:128)
   [java]     at org.junit.runners.Suite.runChild(Suite.java:27)
   [java]     at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
   [java]     at
org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:7

   [java]     at
org.junit.runners.ParentRunner.runChildren(ParentRunner.java:
8)
   [java]     at
org.junit.runners.ParentRunner.access$000(ParentRunner.java:5

   [java]     at
org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:2
)
   [java]     at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
   [java]     at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
   [java]     at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
   [java]     at org.apache.jorphan.test.AllTests.main(AllTests.java:219)
   [java]
   [java] FAILURES!!!
   [java] Tests run: 3213,  Failures: 2
   [java]
   [java] .................................................................
   [java] Time: 5,082
   [java]

   [java] OK (65 tests)
   [java]

Did you ever get this issue? If not, do you know what it can be caused by?

Re: PR390 - update mongo-java-driver version

Posted by Igor Sasovets <is...@gmail.com>.
Oh, it's my fail. Unfortunately,  I did it. Thanks so much for the
information. I'll try it and provide feedback.

Вт, 3 лип. 2018 10:02 користувач Felix Schumacher <
felix.schumacher@internetallee.de> пише:

>
>
> Am 1. Juli 2018 21:03:15 MESZ schrieb Igor Sasovets <is...@gmail.com>:
> >I used ant test [-Djava.awt.headless=true] command
>
> You didn't actually write those square baskets at the command line, did
> you?
>
> They are only in the documentation to indicate that the parameter inside
> the brackets is optional.
>
> Felix
>
> >
> >Нд, 1 лип. 2018 21:38 користувач Felix Schumacher <
> >felix.schumacher@internetallee.de> пише:
> >
> >>
> >>
> >> Am 01.07.2018 um 19:55 schrieb Igor Sasovets:
> >> > Felix, I fixed problems with built. These issues appeared due to
> >> deprecated
> >> > methods in mongo-java-driver. But now I'm trying to find failed
> >test.
> >> How I
> >> > can exactly know which test failed because test name not displayed
> >in
> >> > console?
> >> >
> >> Test failures should be visible in the console. How do you run the
> >tests?
> >>
> >> Regards,
> >>   Felix
> >>
> >>
>

Re: PR390 - update mongo-java-driver version

Posted by Felix Schumacher <fe...@internetallee.de>.

Am 1. Juli 2018 21:03:15 MESZ schrieb Igor Sasovets <is...@gmail.com>:
>I used ant test [-Djava.awt.headless=true] command

You didn't actually write those square baskets at the command line, did you?

They are only in the documentation to indicate that the parameter inside the brackets is optional. 

Felix 

>
>Нд, 1 лип. 2018 21:38 користувач Felix Schumacher <
>felix.schumacher@internetallee.de> пише:
>
>>
>>
>> Am 01.07.2018 um 19:55 schrieb Igor Sasovets:
>> > Felix, I fixed problems with built. These issues appeared due to
>> deprecated
>> > methods in mongo-java-driver. But now I'm trying to find failed
>test.
>> How I
>> > can exactly know which test failed because test name not displayed
>in
>> > console?
>> >
>> Test failures should be visible in the console. How do you run the
>tests?
>>
>> Regards,
>>   Felix
>>
>>

Re: PR390 - update mongo-java-driver version

Posted by Felix Schumacher <fe...@internetallee.de>.

Am 02.07.2018 um 22:50 schrieb Igor Sasovets:
> Also, please describe how I can debug tests or add some extra logs using
> comand line args because I spent too much time for the investigation and
> didn't find anything that would help me.
>
A simple google search led me to these three links for "debug jmeter in 
eclipse":
  * https://www.blazemeter.com/blog/how-debug-your-apache-jmeter-script
  * 
https://stackoverflow.com/questions/21176130/debugging-jmeter-java-request-class-single-stepping-in-eclipse
  * https://garygregory.wordpress.com/2013/01/11/debugging-jmeter/

If you want to adjust logging output have a look at
http://jmeter.apache.org/usermanual/get-started.html#logging

Regards,
  Felix

Re: PR390 - update mongo-java-driver version

Posted by Igor Sasovets <is...@gmail.com>.
Also, please describe how I can debug tests or add some extra logs using
comand line args because I spent too much time for the investigation and
didn't find anything that would help me.

Re: PR390 - update mongo-java-driver version

Posted by Felix Schumacher <fe...@internetallee.de>.

Am 2. Juli 2018 21:22:22 MESZ schrieb Igor Sasovets <is...@gmail.com>:
>Felix, I didn't find jmeter-test.log file in repository. Where I can
>find
>tests? Could you please send me list of files in which tests located.

If you run 'ant test' you will have to do that from the source directory, the jmeter-test.log should be right there. 

Regards, 
 Felix 

Re: PR390 - update mongo-java-driver version

Posted by Igor Sasovets <is...@gmail.com>.
Felix, I didn't find jmeter-test.log file in repository. Where I can find
tests? Could you please send me list of files in which tests located.

Re: PR390 - update mongo-java-driver version

Posted by Felix Schumacher <fe...@internetallee.de>.

Am 1. Juli 2018 22:39:47 MESZ schrieb Igor Sasovets <is...@gmail.com>:
>Here is console ouput.

The snippet from your output below points at a problem in your gui setup. 

     [java] There was 1 failure:
     [java] 1) errorDetected(org.apache.jmeter.testbeans.gui.PackageTest)
     [java] junit.framework.AssertionFailedError: One or more errors detected -
see log file
     [java]     at junit.framework.Assert.fail(Assert.java:57)
     [java]     at junit.framework.TestCase.fail(TestCase.java:227)
     [java]     at org.apache.jmeter.testbeans.gui.PackageTest.errorDetected(Pac
kageTest.java:212)

You can either try to make gui testing possible, or run the tests headless by adding - Dawt.headless=true to free ant run. 

The log file, that is mentioned in your output is probably named jmeter-test.log. Have a look if you find something useful there, too. 

Regards, 
 Felix 
>
>Best regards,
>Igor

Re: PR390 - update mongo-java-driver version

Posted by Igor Sasovets <is...@gmail.com>.
Here is console ouput.

Best regards,
Igor

Re: PR390 - update mongo-java-driver version

Posted by Felix Schumacher <fe...@internetallee.de>.

Am 1. Juli 2018 21:03:15 MESZ schrieb Igor Sasovets <is...@gmail.com>:
>I used ant test [-Djava.awt.headless=true] command

What did the command produce?

Hint there are no tests for the Mongo sampler, so it is unlikely, that any changes on that part should produce test errors. 

Regards, 
 Felix 

>
>Нд, 1 лип. 2018 21:38 користувач Felix Schumacher <
>felix.schumacher@internetallee.de> пише:
>
>>
>>
>> Am 01.07.2018 um 19:55 schrieb Igor Sasovets:
>> > Felix, I fixed problems with built. These issues appeared due to
>> deprecated
>> > methods in mongo-java-driver. But now I'm trying to find failed
>test.
>> How I
>> > can exactly know which test failed because test name not displayed
>in
>> > console?
>> >
>> Test failures should be visible in the console. How do you run the
>tests?
>>
>> Regards,
>>   Felix
>>
>>

Re: PR390 - update mongo-java-driver version

Posted by Igor Sasovets <is...@gmail.com>.
I used ant test [-Djava.awt.headless=true] command

Нд, 1 лип. 2018 21:38 користувач Felix Schumacher <
felix.schumacher@internetallee.de> пише:

>
>
> Am 01.07.2018 um 19:55 schrieb Igor Sasovets:
> > Felix, I fixed problems with built. These issues appeared due to
> deprecated
> > methods in mongo-java-driver. But now I'm trying to find failed test.
> How I
> > can exactly know which test failed because test name not displayed in
> > console?
> >
> Test failures should be visible in the console. How do you run the tests?
>
> Regards,
>   Felix
>
>

Re: PR390 - update mongo-java-driver version

Posted by Felix Schumacher <fe...@internetallee.de>.

Am 01.07.2018 um 19:55 schrieb Igor Sasovets:
> Felix, I fixed problems with built. These issues appeared due to deprecated
> methods in mongo-java-driver. But now I'm trying to find failed test. How I
> can exactly know which test failed because test name not displayed in
> console?
>
Test failures should be visible in the console. How do you run the tests?

Regards,
  Felix


Re: PR390 - update mongo-java-driver version

Posted by Igor Sasovets <is...@gmail.com>.
Felix, I fixed problems with built. These issues appeared due to deprecated
methods in mongo-java-driver. But now I'm trying to find failed test. How I
can exactly know which test failed because test name not displayed in
console?

Re: PR390 - update mongo-java-driver version

Posted by Felix Schumacher <fe...@internetallee.de>.

Am 01.07.2018 um 10:08 schrieb Igor Sasovets:
> Hi, Team! Recently I opened PR to apache/jmeter github repository:
> https://github.com/apache/jmeter/pull/390. Main aim of this PR is to allow
> users apply JMeter for projects which use MongoDB database.  I wanted to
> test my application that uses MongoDB database using JMeter but faced with
> problems which related to mongo-java-driver version. Since MongoDB config
> deprecated, I used JSR232 Sampler and wrote Java code that allows me to
> interact with database. Current version of mongo-java-driver (2.11.3) is
> out of date and I couldn't connect to my DB using created script. So, I
> decided to update mongo-java-driver version because it allows to use JMeter
> with MongoDB and has big impact to user experience (at least, for me and my
> colleagues). PR build failed due to problem with version of ant.

Hi Igor,

thanks for taking the discussion onto the mailing list.

The wrong ant version (on travis ci) was only a minor problem. The real 
problem with the pull request are:

  * the current version of the mongodb api has deprecated and removed 
some methods, that our old sampler uses.
  * the old sampler has been deprecated since version 3.0 as it seemed 
that there was no interest in maintaining it anymore and usage seemed to 
be low (to nonexistant).

So updating the jars on its own, will not help.

As linked in the PR comments, I tried to change the sampler to use the 
new API, but I couldn't do it while keeping backwards compatibility 
(which would be really good to have). So it might be better to use that 
as a start for a new sampler.

As Andrey pointed out, it might be better to split this sampler out of 
JMeter into its own plugin and distribute it separately. I think this 
would be a good idea, but I haven't done this before and am not sure 
about the best way to proceed here.

Would the new plugin need a new home, or could/should we maintain it as 
a subproject to JMeter?

We would need someone, that could support the plugin (sampler), as this 
was the original cause for us to deprecate it.

So there are quite a few points to discuss in this mail by now:
  * Keep the sampler in JMeter and update it or introduce a new sampler
  * Who could maintain the code
  * Where should the code live

Regards,
  Felix

>