Skip to content

Commit

Permalink
Make test code thread stop if it's interrupted already
Browse files Browse the repository at this point in the history
  • Loading branch information
komamitsu committed Apr 1, 2016
1 parent b87da21 commit f86bed7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/test/java/org/komamitsu/fluency/FluencyTest.java
Expand Up @@ -363,6 +363,11 @@ private void testFluencyBase(final FluencyFactory fluencyFactory, final Options
public void run()
{
for (int i = 0; i < reqNum; i++) {
if (Thread.currentThread().isInterrupted()) {
LOG.info("Interrupted...");
break;
}

if (options.failover) {
if (i == reqNum / 2) {
if (shouldFailOver.getAndSet(false)) {
Expand Down

0 comments on commit f86bed7

Please sign in to comment.