Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
imbyungjun committed Jan 10, 2024
1 parent 28e2a8a commit 3696a71
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
24 changes: 12 additions & 12 deletions ngrinder-core/src/test/java/net/grinder/AgentControllerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -174,25 +174,22 @@ public void testConsoleCommunicationSettingTimeout() throws GrinderProperties.Pe

FileUtils.copyFileToDirectory(
new File(this.getClass().getResource("/long-time-prepare-test.py").getFile()),
new File("./tmp/agent-home/tmp_1/file-store/_default/incoming")
new File("./tmp/agent-home/tmp_0/file-store/_default/incoming")
);

URL scriptUrl = this.getClass().getResource("/long-time-prepare-test.properties");
File scriptFile = new File(scriptUrl.getFile());
GrinderProperties properties = new GrinderProperties(scriptFile);
properties.setAssociatedFile(new File("long-time-prepare-test.properties"));
final MutableBoolean timeouted = new MutableBoolean(false);
console1.addListener(new SingleConsole.ConsoleShutdownListener() {
@Override
public void readyToStop(StopReason stopReason) {
// Notice: it couldn't distinguish between a script error or
// timed out of the keepalive connection.
System.out.println("The stop signal is received " + stopReason);
if (stopReason.equals(SCRIPT_ERROR)) {
timeouted.setValue(true);
}
}
});
console1.addListener(stopReason -> {
// Notice: it couldn't distinguish between a script error or
// timed out of the keepalive connection.
System.out.println("The stop signal is received " + stopReason);
if (stopReason.equals(SCRIPT_ERROR)) {
timeouted.setValue(true);
}
});
console1.startTest(properties);

for (int i = 0; i < 20; i++) {
Expand Down Expand Up @@ -227,6 +224,9 @@ public void testAgentControllerServerDaemonRecovery() {
agentControllerServerDaemon.startAgent(grinderProperties, getAgentIdentity(allAvailableAgents, 0));
agentControllerServerDaemon.startAgent(grinderProperties, getAgentIdentity(allAvailableAgents, 1));

// agentDaemon에 들어가는 config...
// 에이전트 두대. 아.. 안붙은게 문제네??? 흠.
// 파일 생성은 어디?
waitAndAssertUntilAgentAttachedTo(console1, 2, 10);

// Shutdown agent controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ abstract public class AbstractMultiGrinderTestBase {

@Before
public void agentInit() {
agentConfig1 = new AgentConfig.NullAgentConfig(1);
agentConfig1 = new AgentConfig.NullAgentConfig(0);
agentConfig1.init();

agentConfig2 = new AgentConfig.NullAgentConfig(1);
agentConfig2.init();

agentConfig3 = new AgentConfig.NullAgentConfig(1);
agentConfig3 = new AgentConfig.NullAgentConfig(2);
agentConfig3.init();
}

Expand Down

0 comments on commit 3696a71

Please sign in to comment.