안녕하세요.
며칠간 혼자서 해보려고 하다가 문의 드려봅니다. controller 1대 - agent 1대 - host 1대와 vuser는 1개로 performance test를 진행중이고 1차 성공했습니다. 그런데 agent를 다른 PC로 바꾸어 test를 진행하였더니 계속 오류가 발생합니다. 1. System 정보 a. controller (windows 10, Intel Xeon 48core 64bit, 64GB RAM) b. agent 1. controller와 동일한 환경 - pass 2. Dell blade server(Intel Xeon 52core, 256GB RAM, Windows Server 2012) - fail 발생 3. Dell blade server(Intel Xeon 52core, 256GB RAM, CentOS7.3) - fail 발생 4. Controller와 동일 PC에 Virtual BOX 설치 후 Windows 10 설치 - fail 발생 c. host (custom server, Intel Xeon-D 8core, 64GB RAM, CentOS 6.7) 2. Software 환경 a. Java Machine : controller/agent/host 모두 동일한 최신 버전 -------------java -version ------------------------------------------------- java version "1.8.0_121" Java(TM) SE Runtime Environment (build 1.8.0_121-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode) ------------------------------------------------------------------------------- Java Path는 모두 동일하게 설정 b. nGrinder version : 3.4 최신 버전 사용 Controller와 동일한 PC에 Agent 설치하여 performance test 했을 경우 monitor까지 모두 정상 동작합니다. 그런데 agent를 다른 PC로 바꾸면 아래와 같은 error가 발생합니다. ---controller GUI상 error log ---------------- Console is being prepared. Console is started on port 12003 1 agents are starting. 1 agents are ready. All necessary files are being distributed. - TestRunner.groovy All necessary files are distributed. The test is ready to start. The test is started. Script error ------------------------------------------------ 물론 agent.conf를 수정하여 controller IP로 정상 입력하였고, 두개가 연결되어 agent management에 정상적으로 나타나는것을 확인하였습니다. Agent상 error log는 아래와 같습니다. java 설정 문제로 의심되어 모든환경을 동일하게 하였는데...특정1대를 제외하고는 안되네요... 도움좀 부탁드립니다. -----------agent.log------------------------------------ 017-01-31 21:55:11,429 INFO starter : *************************************************** 2017-01-31 21:55:11,444 INFO starter : Start nGrinder Agent ... 2017-01-31 21:55:11,444 INFO starter : *************************************************** 2017-01-31 21:55:11,444 INFO starter : JVM server mode is disabled. 2017-01-31 21:55:11,491 INFO starter : connecting to controller 192.168.10.138:16001 2017-01-31 21:55:11,523 INFO agent controller daemon : The agent controller daemon is started. 2017-01-31 21:55:12,132 INFO agent controller : Connected to agent controller server at /192.168.10.138:16001 2017-01-31 21:55:12,132 INFO agent controller : Waiting for agent controller server signal 2017-01-31 21:55:41,350 INFO agent controller : Received a agent update message 0 2017-01-31 21:55:41,350 INFO agent controller : same or old agent version 3.4 is sent for update. skip this. 2017-01-31 21:55:41,366 INFO agent controller : Waiting for agent controller server signal 2017-01-31 21:56:56,856 INFO agent controller : Received a start agent message 2017-01-31 21:56:56,861 INFO agent controller : Agent start message is received from controller net.grinder.messages.agent.StartGrinderMessage@71194fdb 2017-01-31 21:56:56,865 INFO agent controller : Starting agent... for test_76 2017-01-31 21:56:56,865 INFO agent daemon : Agent daemon connecting to port 12003 is started. 2017-01-31 21:56:56,865 INFO agent controller : Agent is started. Waiting for agent controller signal 2017-01-31 21:56:56,881 INFO agent daemon : The Grinder 3.9.1 2017-01-31 21:56:56,913 INFO agent daemon : Connect to console at /192.168.10.138:12003 2017-01-31 21:56:56,913 INFO agent daemon : Waiting for console signal 2017-01-31 21:56:57,742 INFO agent daemon : Clearing file store 2017-01-31 21:56:57,757 INFO agent daemon : Updating file store: "TestRunner.groovy" (2305 bytes) 2017-01-31 21:56:58,819 INFO agent daemon : received a start message 2017-01-31 21:56:58,819 INFO agent daemon : log file : C:\Users\khujin\.ngrinder_agent\log\test_76\DESKTOP-E3CFM7T-0.log 2017-01-31 21:56:58,856 INFO agent daemon : grinder properties {grinder.reportToConsole.interval=500, grinder.ignoreSampleCount=0, grinder.processes=2, ngrinder.etc.hosts=192.168.100.160, grinder.processIncrement=0, grinder.numberOfOldLogs=1, grinder.dcrinstrumentation=true, grinder.jvm=java, grinder.runs=0, grinder.user=admin, grinder.logProcessStreams=true, grinder.test.id=test_76, grinder.agents=1, grinder.security=false, grinder.consolePort=12003, grinder.duration=60000, grinder.useConsole=true, grinder.jvm.classpath=C:\ngrinder\ngrinder-agent-3.4\ngrinder-agent\lib\ngrinder-runtime-3.4.jar;C:\ngrinder\ngrinder-agent-3.4\ngrinder-agent\lib\grinder-patch-3.9.1-patch.jar;C:\Users\khujin\.ngrinder_agent\file-store\admin\current\, grinder.threads=5, grinder.script=TestRunner.groovy, grinder.reportTimesToConsole=true, grinder.debug.singleprocess=false, grinder.sleepTimeFactor=1, grinder.sleepTimeVariation=0.2, grinder.logDirectory=C:\Users\khujin\.ngrinder_agent\log\test_76, grinder.consoleHost=192.168.10.138} 2017-01-31 21:56:58,928 INFO agent daemon : jvm arguments -Djna.library.path=C:\Users\khujin\.ngrinder_agent\file-store\admin\current\lib -Dpython.path=C:\Users\khujin\.ngrinder_agent\file-store\admin\current\lib -Dpython.cachedir=C:\Users\khujin\AppData\Local\Temp\jython -Dngrinder.etc.hosts=DESKTOP-E3CFM7T:127.0.0.1,localhost:127.0.0.1, -Dsun.net.spi.nameservice.provider.1=dns,LocalManagedDns -Xms1024m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=128m 2017-01-31 21:56:58,966 INFO agent daemon : Worker process command line: java '-javaagent:C:\ngrinder\ngrinder-agent-3.4\ngrinder-agent\lib\grinder-dcr-agent-3.9.1.jar' '-Djna.library.path=C:\Users\khujin\.ngrinder_agent\file-store\admin\current\lib' '-Dpython.path=C:\Users\khujin\.ngrinder_agent\file-store\admin\current\lib' '-Dpython.cachedir=C:\Users\khujin\AppData\Local\Temp\jython' '-Dngrinder.etc.hosts=DESKTOP-E3CFM7T:127.0.0.1,localhost:127.0.0.1,' '-Dsun.net.spi.nameservice.provider.1=dns,LocalManagedDns' '-Xms1024m' '-Xmx1024m' '-XX:PermSize=128m' '-XX:MaxPermSize=128m' -classpath 'C:\ngrinder\ngrinder-agent-3.4\ngrinder-agent\lib\ngrinder-runtime-3.4.jar;C:\ngrinder\ngrinder-agent-3.4\ngrinder-agent\lib\grinder-patch-3.9.1-patch.jar;.;C:\ngrinder\ngrinder-agent-3.4\ngrinder-agent\lib\asm-3.3.1.jar;C:\ngrinder\ngrinder-agent-3.4\ngrinder-agent\lib\commons-io-2.0.1.jar;C:\ngrinder\ngrinder-agent-3.4\ngrinder-agent\lib\commons-lang-2.6.jar;C:\ngrinder\ngrinder-agent-3.4\ngrinder-agent\lib\dnsjava-2.1.1.jar;C:\ngrinder\ngrinder-agent-3.4\ngrinder-agent\lib\grinder-core-3.9.1.jar;C:\ngrinder\ngrinder-agent-3.4\ngrinder-agent\lib\grinder-dcr-agent-3.9.1.jar;C:\ngrinder\ngrinder-agent-3.4\ngrinder-agent\lib\grinder-http-3.9.1.jar;C:\ngrinder\ngrinder-agent-3.4\ngrinder-agent\lib\grinder-httpclient-3.9.1.jar;C:\ngrinder\ngrinder-agent-3.4\ngrinder-agent\lib\groovy-all-2.2.1.jar;C:\ngrinder\ngrinder-agent-3.4\ngrinder-agent\lib\hamcrest-all-1.1.jar;C:\ngrinder\ngrinder-agent-3.4\ngrinder-agent\lib\json-20090211.jar;C:\ngrinder\ngrinder-agent-3.4\ngrinder-agent\lib\junit-dep-4.8.2.jar;C:\ngrinder\ngrinder-agent-3.4\ngrinder-agent\lib\logback-classic-1.0.0.jar;C:\ngrinder\ngrinder-agent-3.4\ngrinder-agent\lib\logback-core-1.0.0.jar;C:\ngrinder\ngrinder-agent-3.4\ngrinder-agent\lib\ngrinder-groovy-3.4.jar;C:\ngrinder\ngrinder-agent-3.4\ngrinder-agent\lib\ngrinder-runtime-3.4.jar;C:\ngrinder\ngrinder-agent-3.4\ngrinder-agent\lib\picocontainer-2.13.6.jar;C:\ngrinder\ngrinder-agent-3.4\ngrinder-agent\lib\slf4j-api-1.6.4.jar' net.grinder.engine.process.WorkerProcessEntryPoint 2017-01-31 21:56:59,116 INFO agent daemon : worker DESKTOP-E3CFM7T-0 started 2017-01-31 21:56:59,116 INFO agent daemon : worker DESKTOP-E3CFM7T-1 started 2017-01-31 21:57:00,335 INFO agent daemon : All workers are finished 2017-01-31 21:57:00,350 INFO agent daemon : communication shut down 2017-01-31 21:57:00,350 INFO agent daemon : Test shuts down. 2017-01-31 21:57:00,350 INFO agent controller : Send log for test_76 2017-01-31 21:57:00,366 INFO agent controller : Clean up the perftest logs ------------------------------------------------------------------------------------------------ |
Agent의 CMD상 error log는 아래와 같습니다.
2017-01-31 21:56:59,116 INFO agent daemon: worker DESKTOP-E3CFM7T-0 started 2017-01-31 21:56:59,116 INFO agent daemon: worker DESKTOP-E3CFM7T-1 started Failed to instantiate [ch.qos.logback.classic.LoggerContext]Failed to instantiate [ch.qos.logback.classic.LoggerContext] Reported exception: java.util.ServiceConfigurationError: sun.net.spi.nameservice.NameServiceDescriptor: Provider org.ngrinder.dns.LocalManagedDnsDescriptor could not be instantiated at java.util.ServiceLoader.fail(ServiceLoader.java:232) at java.util.ServiceLoader.access$100(ServiceLoader.java:185) at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:384) at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404) at java.util.ServiceLoader$1.next(ServiceLoader.java:480) at java.net.InetAddress$3.run(InetAddress.java:945) at java.net.InetAddress$3.run(InetAddress.java:939) at java.security.AccessController.doPrivileged(Native Method) at java.net.InetAddress.createNSProvider(InetAddress.java:938) at java.net.InetAddress.<clinit>(InetAddress.java:983) at ch.qos.logback.core.util.ContextUtil.getLocalHostName(ContextUtil.java:32) Reported exception: java.util.ServiceConfigurationError: sun.net.spi.nameservice.NameServiceDescriptor: Provider org.ngrinder.dns.LocalManagedDnsDescriptor could not be instantiated at java.util.ServiceLoader.fail(ServiceLoader.java:232) at java.util.ServiceLoader.access$100(ServiceLoader.java:185) at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:384) at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404) at java.util.ServiceLoader$1.next(ServiceLoader.java:480) at java.net.InetAddress$3.run(InetAddress.java:945) at java.net.InetAddress$3.run(InetAddress.java:939) at java.security.AccessController.doPrivileged(Native Method) at java.net.InetAddress.createNSProvider(InetAddress.java:938) at java.net.InetAddress.<clinit>(InetAddress.java:983) at ch.qos.logback.core.util.ContextUtil.getLocalHostName(ContextUtil.java:32) at ch.qos.logback.core.util.ContextUtil.addHostNameAsProperty(ContextUtil.java:41) at ch.qos.logback.classic.joran.action.ConfigurationAction.begin(ConfigurationAction.java:48) at ch.qos.logback.core.joran.spi.Interpreter.callBeginAction(Interpreter.java:276) at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:148) at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:130) at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:50) at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:147) at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:133) at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:96) at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:55) at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75) at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:148) at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:84) at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:54) at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128) at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108) at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:279) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:252) at net.grinder.engine.process.WorkerProcessEntryPoint.run(WorkerProcessEntryPoint.java:73) at net.grinder.engine.process.WorkerProcessEntryPoint.main(WorkerProcessEntryPoint.java:60) Caused by: java.lang.ExceptionInInitializerError at org.ngrinder.dns.LocalManagedDnsImpl.<init>(LocalManagedDnsImpl.java:33) at org.ngrinder.dns.LocalManagedDnsProxy.<init>(LocalManagedDnsProxy.java:30) at org.ngrinder.dns.LocalManagedDnsDescriptor.<clinit>(LocalManagedDnsDescriptor.java:29) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at java.lang.Class.newInstance(Class.java:442) at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:380) ... 28 more Caused by: java.lang.NullPointerException at java.net.InetAddress.getAllByName0(InetAddress.java:1282) at java.net.InetAddress.getAllByName(InetAddress.java:1192) at java.net.InetAddress.getAllByName(InetAddress.java:1126) at java.net.InetAddress.getByName(InetAddress.java:1076) at org.xbill.DNS.SimpleResolver.<init>(SimpleResolver.java:56) at org.xbill.DNS.SimpleResolver.<init>(SimpleResolver.java:68) at org.xbill.DNS.ExtendedResolver.<init>(ExtendedResolver.java:266) at org.xbill.DNS.Lookup.refreshDefault(Lookup.java:86) at org.xbill.DNS.Lookup.<clinit>(Lookup.java:97) ... 37 more at ch.qos.logback.core.util.ContextUtil.addHostNameAsProperty(ContextUtil.java:41) at ch.qos.logback.classic.joran.action.ConfigurationAction.begin(ConfigurationAction.java:48) at ch.qos.logback.core.joran.spi.Interpreter.callBeginAction(Interpreter.java:276) at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:148) at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:130) at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:50) at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:147) at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:133) at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:96) at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:55) at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75) at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:148) at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:84) at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:54) at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128) at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108) at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:279) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:252) at net.grinder.engine.process.WorkerProcessEntryPoint.run(WorkerProcessEntryPoint.java:73) at net.grinder.engine.process.WorkerProcessEntryPoint.main(WorkerProcessEntryPoint.java:60) Caused by: java.lang.ExceptionInInitializerError at org.ngrinder.dns.LocalManagedDnsImpl.<init>(LocalManagedDnsImpl.java:33) at org.ngrinder.dns.LocalManagedDnsProxy.<init>(LocalManagedDnsProxy.java:30) at org.ngrinder.dns.LocalManagedDnsDescriptor.<clinit>(LocalManagedDnsDescriptor.java:29) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at java.lang.Class.newInstance(Class.java:442) at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:380) ... 28 more Caused by: java.lang.NullPointerException at java.net.InetAddress.getAllByName0(InetAddress.java:1282) at java.net.InetAddress.getAllByName(InetAddress.java:1192) at java.net.InetAddress.getAllByName(InetAddress.java:1126) at java.net.InetAddress.getByName(InetAddress.java:1076) at org.xbill.DNS.SimpleResolver.<init>(SimpleResolver.java:56) at org.xbill.DNS.SimpleResolver.<init>(SimpleResolver.java:68) at org.xbill.DNS.ExtendedResolver.<init>(ExtendedResolver.java:266) at org.xbill.DNS.Lookup.refreshDefault(Lookup.java:86) at org.xbill.DNS.Lookup.<clinit>(Lookup.java:97) ... 37 more Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class java.net.InetAddress at ch.qos.logback.core.util.ContextUtil.getLocalHostName(ContextUtil.java:32) at ch.qos.logback.core.util.ContextUtil.addHostNameAsProperty(ContextUtil.java:41) at ch.qos.logback.classic.joran.action.ConfigurationAction.begin(ConfigurationAction.java:48) at ch.qos.logback.core.joran.spi.Interpreter.callBeginAction(Interpreter.java:276) at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:148) at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:130) at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:50) at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:147) at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:133) at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:96) at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:55) at net.grinder.engine.process.GrinderProcess.configureLogging(GrinderProcess.java:257) at net.grinder.engine.process.GrinderProcess.<init>(GrinderProcess.java:141) at net.grinder.engine.process.WorkerProcessEntryPoint.run(WorkerProcessEntryPoint.java:78) at net.grinder.engine.process.WorkerProcessEntryPoint.main(WorkerProcessEntryPoint.java:60) Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class java.net.InetAddress at ch.qos.logback.core.util.ContextUtil.getLocalHostName(ContextUtil.java:32) at ch.qos.logback.core.util.ContextUtil.addHostNameAsProperty(ContextUtil.java:41) at ch.qos.logback.classic.joran.action.ConfigurationAction.begin(ConfigurationAction.java:48) at ch.qos.logback.core.joran.spi.Interpreter.callBeginAction(Interpreter.java:276) at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:148) at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:130) at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:50) at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:147) at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:133) at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:96) at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:55) at net.grinder.engine.process.GrinderProcess.configureLogging(GrinderProcess.java:257) at net.grinder.engine.process.GrinderProcess.<init>(GrinderProcess.java:141) at net.grinder.engine.process.WorkerProcessEntryPoint.run(WorkerProcessEntryPoint.java:78) at net.grinder.engine.process.WorkerProcessEntryPoint.main(WorkerProcessEntryPoint.java:60) Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0 Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0 Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0 Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0 2017-01-31 21:57:00,335 INFO agent daemon: All workers are finished 2017-01-31 21:57:00,350 INFO agent daemon: communication shut down 2017-01-31 21:57:00,350 INFO agent daemon: Test shuts down. 2017-01-31 21:57:00,350 INFO agent controller: Send log for test_76 2017-01-31 21:57:00,366 INFO agent controller: Clean up the perftest logs |
혹시나 싶어 erorr가 발생하는 agent PC에 controller를 모두 설치하여 localhost로 performance test를 진행하여도, agent에서 script error가 발생합니다.
Windows, Linux 둘다 동일합니다. |
Script는 아래와 같이 기본을 사용하였습니다.
-------------------------------------- import static net.grinder.script.Grinder.grinder import static org.junit.Assert.* import static org.hamcrest.Matchers.* import net.grinder.plugin.http.HTTPRequest import net.grinder.plugin.http.HTTPPluginControl import net.grinder.script.GTest import net.grinder.script.Grinder import net.grinder.scriptengine.groovy.junit.GrinderRunner import net.grinder.scriptengine.groovy.junit.annotation.BeforeProcess import net.grinder.scriptengine.groovy.junit.annotation.BeforeThread // import static net.grinder.util.GrinderUtils.* // You can use this if you're using nGrinder after 3.2.3 import org.junit.Before import org.junit.BeforeClass import org.junit.Test import org.junit.runner.RunWith import java.util.Date import java.util.List import java.util.ArrayList import HTTPClient.Cookie import HTTPClient.CookieModule import HTTPClient.HTTPResponse import HTTPClient.NVPair /** * A simple example using the HTTP plugin that shows the retrieval of a * single page via HTTP. * * This script is automatically generated by ngrinder. * * @author admin */ @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, "192.168.100.160") request = new HTTPRequest() grinder.logger.info("before process."); } @BeforeThread public void beforeThread() { test.record(this, "test") grinder.statistics.delayReports=true; grinder.logger.info("before thread."); } @Before public void before() { request.setHeaders(headers) cookies.each { CookieModule.addCookie(it, HTTPPluginControl.getThreadHTTPClientContext()) } grinder.logger.info("before thread. init headers and cookies"); } @Test public void test(){ HTTPResponse result = request.GET("http://192.168.100.160", params) if (result.statusCode == 301 || result.statusCode == 302) { grinder.logger.warn("Warning. The response may not be correct. The response code was {}.", result.statusCode); } else { assertThat(result.statusCode, is(200)); } } } |
자문자답입니다 ㅎㅎ
error log에 dns 관련 내용이 보여서 agent.conf에 agent.enable_local_dns=false로 했더니 동작합니다... 같은 option에 작동하는 녀석도 있고, 안하는 녀석도 있어 이해는 안되지만 여튼 잘되네요. |
Free forum by Nabble | Edit this page |