[TEST] Add logging to determine if ticker thread is being stopped correctly.

Added some trace logging and set the WatcherStatsTest to trace watcher to try and figure out why the ticker isn't stopping.

Original commit: elastic/x-pack-elasticsearch@75dc936165
This commit is contained in:
Brian Murphy 2015-07-02 11:42:38 -04:00 committed by Martijn van Groningen
parent 3051cca896
commit 12de46e2d4
2 changed files with 5 additions and 0 deletions

View File

@ -154,12 +154,15 @@ public class TickerScheduleTriggerEngine extends ScheduleTriggerEngine {
}
public void close() {
logger.trace("stopping ticker thread");
active = false;
try {
closeLatch.await();
} catch (InterruptedException e) {
logger.warn("caught an interrupted exception when waiting while closing ticker thread", e);
Thread.currentThread().interrupt();
}
logger.trace("ticker thread stopped");
}
}

View File

@ -8,6 +8,7 @@ package org.elasticsearch.watcher.transport.action.stats;
import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope;
import org.elasticsearch.test.junit.annotations.TestLogging;
import org.elasticsearch.watcher.WatcherBuild;
import org.elasticsearch.watcher.WatcherState;
import org.elasticsearch.watcher.WatcherVersion;
@ -37,6 +38,7 @@ import static org.hamcrest.core.IsEqual.equalTo;
/**
*/
@ClusterScope(scope = TEST, numClientNodes = 0, transportClientRatio = 0, randomDynamicTemplates = false)
@TestLogging("watcher:TRACE")
public class WatcherStatsTests extends AbstractWatcherIntegrationTests {
@Test