Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unit test #996

Merged
merged 2 commits into from
Feb 21, 2024
Merged

Fix unit test #996

merged 2 commits into from
Feb 21, 2024

Conversation

imbyungjun
Copy link
Contributor

fixed some unit tests

@imbyungjun imbyungjun self-assigned this Jan 9, 2024
@imbyungjun
Copy link
Contributor Author

net.grinder.AgentControllerTest > testAgentControllerServerDaemonRecovery STANDARD_ERROR
    2024-01-09 09:14:56,475 ERROR agent daemon: Exception occurred in the agent message loop
    net.grinder.engine.agent.FileStore$FileStoreException: Could not create directory '/home/runner/work/ngrinder/ngrinder/ngrinder-core/tmp/agent-home/tmp_1/file-store/_default/incoming'
    	at net.grinder.engine.agent.FileStore.<init>(FileStore.java:96) ~[main/:na]
    	at net.grinder.engine.agent.AgentImplementationEx$ConsoleCommunication.<init>(AgentImplementationEx.java:537) ~[main/:na]
    	at net.grinder.engine.agent.AgentImplementationEx.run(AgentImplementationEx.java:163) ~[main/:na]
    	at net.grinder.AgentDaemon$AgentThreadRunnable.run(AgentDaemon.java:131) [main/:na]
    	at java.lang.Thread.run(Thread.java:750) [na:1.8.0_345]
    Caused by: net.grinder.util.Directory$DirectoryException: Could not create directory '/home/runner/work/ngrinder/ngrinder/ngrinder-core/tmp/agent-home/tmp_1/file-store/_default/incoming'
    	at net.grinder.util.Directory.create(Directory.java:105) ~[grinder-core-3.9.1.jar:na]
    	at net.grinder.engine.agent.FileStore.<init>(FileStore.java:92) ~[main/:na]
    	... 4 common frames omitted

Copy link

✅ Build & Test workflow succeed ✅

@@ -43,13 +43,13 @@ abstract public class AbstractMultiGrinderTestBase {

@Before
public void agentInit() {
agentConfig1 = new AgentConfig.NullAgentConfig(1);
agentConfig1 = new AgentConfig.NullAgentConfig(0);
Copy link
Contributor Author

@imbyungjun imbyungjun Jan 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

static {
System.setProperty("ngrinder.agent.home", "./tmp/agent-home");
}

I think that setting ngrinder.agent.home property as ./tmp/agent-home could derive resource contention. I wanted to fix it but no time. I'll change it if there is a next time.

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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about use private static final Logger LOGGER = LoggerFactory.getLogger(AgentControllerTest.class);?

@imbyungjun imbyungjun merged commit 1c6ba7c into develop Feb 21, 2024
2 checks passed
@imbyungjun imbyungjun deleted the feature/fix-test branch February 21, 2024 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants