Script Stopped by error, reason unclear

classic Classic list List threaded Threaded
9 messages Options
ger
Reply | Threaded
Open this post in threaded view
|

Script Stopped by error, reason unclear

ger
This post was updated on .
Hi,

I try to run this piece of script in nGrinder:
@RunWith(GrinderRunner)
class TestRunner {

        public static GTest test
        public static HTTPRequest request
        public static NVPair[] headers = []
        public static NVPair[] params = []
        public static Cookie[] cookies = []

        @BeforeProcess
        public static void beforeProcess() {
                HTTPPluginControl.getConnectionDefaults().timeout = 6000
                test = new GTest(1, "http://localhost:8080/")
                request = new HTTPRequest()
                grinder.logger.info("before process.");
        }

        @BeforeThread
        public void beforeThread() {
                grinder.logger.info("before thread 1.");
                test.record(this, "test")
                grinder.logger.info("before thread 2.");
                grinder.statistics.delayReports=true;
                grinder.logger.info("before thread 3.");
        }
...more...

But in nGrinder it is stopped because of an error according to the GUI.

In the log I see this:

java '-javaagent:..\..\..\ngrinder-agent\lib\grinder-dcr-agent-3.9.1.jar' '-Djna.library.path=C:\Temp\file-store\admin\current\lib' '-Dpython.path=C:\Temp\file-store\admin\current\lib' '-Dpython.cachedir=C:\Users\ger\AppData\Local\Temp\jython' '-Dngrinder.etc.hosts=machine:127.0.0.1,localhost:127.0.0.1' '-Dsun.net.spi.nameservice.provider.1=dns,LocalManagedDns' '-Xms25m' '-Xmx25m' '-XX:PermSize=50m' '-XX:MaxPermSize=50m' -classpath '..\..\..\ngrinder-agent\lib\ngrinder-runtime-3.4.jar;..\..\..\ngrinder-agent\lib\grinder-patch-3.9.1-patch.jar;.;..\..\..\ngrinder-agent\lib\asm-3.3.1.jar;..\..\..\ngrinder-agent\lib\commons-io-2.0.1.jar;..\..\..\ngrinder-agent\lib\commons-lang-2.6.jar;..\..\..\ngrinder-agent\lib\dnsjava-2.1.1.jar;..\..\..\ngrinder-agent\lib\grinder-core-3.9.1.jar;..\..\..\ngrinder-agent\lib\grinder-dcr-agent-3.9.1.jar;..\..\..\ngrinder-agent\lib\grinder-http-3.9.1.jar;..\..\..\ngrinder-agent\lib\grinder-httpclient-3.9.1.jar;..\..\..\ngrinder-agent\lib\groovy-all-2.2.1.jar;..\..\..\ngrinder-agent\lib\hamcrest-all-1.1.jar;..\..\..\ngrinder-agent\lib\json-20090211.jar;..\..\..\ngrinder-agent\lib\junit-dep-4.8.2.jar;..\..\..\ngrinder-agent\lib\logback-classic-1.0.0.jar;..\..\..\ngrinder-agent\lib\logback-core-1.0.0.jar;..\..\..\ngrinder-agent\lib\ngrinder-groovy-3.4.jar;..\..\..\ngrinder-agent\lib\ngrinder-runtime-3.4.jar;..\..\..\ngrinder-agent\lib\picocontainer-2.13.6.jar;..\..\..\ngrinder-agent\lib\slf4j-api-1.6.4.jar' net.grinder.engine.process.WorkerProcessEntryPoint

2016-11-01 09:52:52,117 INFO  The Grinder version 3.9.1
2016-11-01 09:52:52,126 INFO  Java(TM) SE Runtime Environment 1.7.0_80-b15: Java HotSpot(TM) Client VM (24.80-b11, mixed mode) on Windows 7 x86 6.1
2016-11-01 09:52:52,129 INFO  time zone is CET (+0100)
2016-11-01 09:52:52,297 INFO  worker process 0 of agent number 0
2016-11-01 09:52:52,327 INFO  Instrumentation agents: byte code transforming instrumenter for Java; byte code transforming instrumenter for Java
2016-11-01 09:52:53,922 INFO  registered plug-in net.grinder.plugin.http.HTTPPlugin
2016-11-01 09:52:53,939 INFO  before process.
2016-11-01 09:52:53,942 INFO  Running "TestRunner.groovy" using GroovyScriptEngine running with groovy version: 2.2.1
2016-11-01 09:52:53,966 INFO  before thread 1.
.....
2016-11-01 09:52:54,130 INFO  during test1.
2016-11-01 09:52:54,132 INFO  http://localhost:8080/ -> 200 , 11438 bytes
2016-11-01 09:52:54,132 INFO  after test.
2016-11-01 09:52:54,133 INFO  finished 15 runs
2016-11-01 09:52:54,133 INFO  after thread.
2016-11-01 09:52:54,134 INFO  after process.
2016-11-01 09:52:54,135 INFO  elapsed time is 166 ms
2016-11-01 09:52:54,135 INFO  Final statistics for this process:
2016-11-01 09:52:54,145 INFO  
             Tests        Errors       Mean Test    Test Time    TPS          Mean         Response     Response     Mean time to Mean time to Mean time to
                                       Time (ms)    Standard                  response     bytes per    errors       resolve host establish    first byte  
                                                    Deviation                 length       second                                 connection                
                                                    (ms)                                                                                                    


Totals       0            0            ?            0,00         0,00         ?            0,00         0            ?            ?            ?            

  Tests resulting in error only contribute to the Errors column.          
  Statistics for individual tests can be found in the data file, including
  (possibly incomplete) statistics for erroneous tests. Composite tests  
  are marked with () and not included in the totals.                      



So the "Final statistics for this process:" are collected, but afterwards it stopped.

Could you please help me with this?
I really don't understand what's causing this issue. When I run this script in Eclipse with JUnit it runs fine without errors.

Thanks in advance!
Reply | Threaded
Open this post in threaded view
|

Re: Script Stopped by error, reason unclear

jefferson
Does you script work from within your IDE (Eclipse, IntelliJ)?
Ger
Reply | Threaded
Open this post in threaded view
|

Re: Script Stopped by error, reason unclear

Ger
Hi,

Yes, my script runs fine in Eclipse, so syntactically it looks OK.
Is there a way to retrieve more information about the cause or location of the script error?
Reply | Threaded
Open this post in threaded view
|

Re: Script Stopped by error, reason unclear

junoyoon
Administrator
Which path did u install agent?
agent should be installed in the path which doesn't contain space.
ger
Reply | Threaded
Open this post in threaded view
|

Re: Script Stopped by error, reason unclear

ger
This post was updated on .
Hi,

For the time being I installed the agent on "C:\Temp\ngrinder-agent".
This is in the agent.conf:
common.start_mode=agent
agent.controller_host=localhost
agent.controller_port=16001
agent.region=NONE
#agent.host_id=
#agent.server_mode=true

# provide more agent java execution option if necessary.
#agent.java_opt=
# set following false if you want to use more than 1G Xmx memory per a agent process.
#agent.limit_xmx=true
# please uncomment the following option if you want to send all logs to the controller.
#agent.all_logs=true
# some jvm is not compatible with DNSJava. If so, set this false.
#agent.enable_local_dns=false


I also see in the downloadable zipfile that my script has ended and run correctly:

...(removed some rows)...
2016-11-01 09:52:54,135 INFO  elapsed time is 166 ms
2016-11-01 09:52:54,135 INFO  Final statistics for this process:
2016-11-01 09:52:54,145 INFO  
             Tests        Errors       Mean Test    Test Time    TPS          Mean         Response     Response     Mean time to Mean time to Mean time to
                                       Time (ms)    Standard                  response     bytes per    errors       resolve host establish    first byte  
                                                    Deviation                 length       second                                 connection                
                                                    (ms)                                                                                                    


Totals       0            0            ?            0,00         0,00         ?            0,00         0            ?            ?            ?            

  Tests resulting in error only contribute to the Errors column.          
  Statistics for individual tests can be found in the data file, including
  (possibly incomplete) statistics for erroneous tests. Composite tests  
  are marked with () and not included in the totals.      


But still there's a SCRIPT ERROR in the gui.
Reply | Threaded
Open this post in threaded view
|

Re: Script Stopped by error, reason unclear

junoyoon
Administrator
You may record wrong method.

Do you have the test method named "test()"?
ger
Reply | Threaded
Open this post in threaded view
|

Re: Script Stopped by error, reason unclear

ger
Hi,

I indeed didn't have the function test(), but I had this in my script:

        @Test
        public void test1(){...}

Now I change it, it's working!!

But when I have a look on this page, there's also no test() method: http://www.cubrid.org/wiki_ngrinder/entry/how-to-run-the-multiple-tests-with-different-weight-groovy-way

How should I use the @RunRate in this case?

Reply | Threaded
Open this post in threaded view
|

Re: Script Stopped by error, reason unclear

junoyoon
Administrator
if so, you have to change

test.record(this, "test")

to

test.record(this, "your_test_method_name")

so that your_test_method_name method can be recorded.
ger
Reply | Threaded
Open this post in threaded view
|

Re: Script Stopped by error, reason unclear

ger
Thanks!! This was indeed the issue. Now it's running fine.

It looks like the @RunRate-annotation is giving errors in combination with the setting "Run Count". In that case I get the error "[ERROR] All agents are unexpectedly lost".
To solve this error I changed the Test Configuration from "Run Count" to "Duration". Is it a known bug that @RunRate and "Run Count" isn't a good combination?