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

Add fallback to cleanup perftest resources #983

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
import java.util.List;
import java.util.Set;

import static java.time.Instant.*;
import static java.time.Instant.now;
import static java.time.Instant.ofEpochMilli;
import static java.time.temporal.ChronoUnit.MINUTES;
import static java.util.Arrays.asList;
import static java.util.Objects.requireNonNull;
Expand Down Expand Up @@ -229,6 +230,8 @@ public void doTest(final PerfTest perfTest) {
LOG.debug("Stack Trace is : ", ex);
doTerminate(perfTest, singleConsole, ex.getMessage());
notifyFinish(perfTest, StopReason.ERROR_WHILE_PREPARE);
} finally {
cleanUp(perfTest);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add fallback to cleanup resource.

  1. delete dist folder.
  2. delete hazelcast map data for sampling.

}
}

Expand All @@ -254,7 +257,7 @@ private void deleteCachedDistFiles(File distDir,
}

/**
* Extract non cached distribution files for send to each agents.
* Extract non cached distribution files for send to each agent.
*
* @param distFilesDigest Required file's digest for currently running test.
* @param agentCachedDistFilesDigestList Digest of files in each agent cache directory.
Expand Down
3 changes: 1 addition & 2 deletions ngrinder-core/src/main/java/net/grinder/SingleConsole.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ForkJoinPool;


import static java.util.Arrays.stream;
import static java.util.Collections.synchronizedMap;
import static org.ngrinder.common.util.CollectionUtils.*;
Expand Down Expand Up @@ -461,7 +460,7 @@ private void checkSafetyWithCacheState(final FileDistribution fileDistribution,

/**
* Wait until the given size of agents are all connected and receive digest from there cached files.
* It wait until 10 sec.
* It waits until 10 sec.
*
* @param size size of agent.
*/
Expand Down
Loading