summaryrefslogtreecommitdiff
path: root/core/src/test/java/org/elasticsearch/action/support
diff options
context:
space:
mode:
authorNik Everett <nik9000@gmail.com>2016-12-23 15:51:09 -0500
committerNik Everett <nik9000@gmail.com>2017-01-06 20:03:32 -0500
commit12923ef8961f40abded8341f00881a163f7c68a9 (patch)
treef575d28d2d4c98dd4528aaf339514d7a7d3c7210 /core/src/test/java/org/elasticsearch/action/support
parentb0c009ae769877594ada8a2b05267463caebf274 (diff)
Close and flush refresh listeners on shard close
Right now closing a shard looks like it strands refresh listeners, causing tests like `delete/50_refresh/refresh=wait_for waits until changes are visible in search` to fail. Here is a build that fails: https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+multi_cluster_search+multijob-darwin-compatibility/4/console This attempts to fix the problem by implements `Closeable` on `RefreshListeners` and rejecting listeners when closed. More importantly the act of closing the instance flushes all pending listeners so we shouldn't have any stranded listeners on close. Because it was needed for testing, this also adds the number of pending listeners to the `CommonStats` object and all API to which that flows: `_cat/nodes`, `_cat/indices`, `_cat/shards`, and `_nodes/stats`.
Diffstat (limited to 'core/src/test/java/org/elasticsearch/action/support')
-rw-r--r--core/src/test/java/org/elasticsearch/action/support/replication/TransportWriteActionTests.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/src/test/java/org/elasticsearch/action/support/replication/TransportWriteActionTests.java b/core/src/test/java/org/elasticsearch/action/support/replication/TransportWriteActionTests.java
index cd71418f0e..e27d3a5b04 100644
--- a/core/src/test/java/org/elasticsearch/action/support/replication/TransportWriteActionTests.java
+++ b/core/src/test/java/org/elasticsearch/action/support/replication/TransportWriteActionTests.java
@@ -116,7 +116,7 @@ public class TransportWriteActionTests extends ESTestCase {
Result result = action.apply(new TestAction(), request, indexShard);
CapturingActionListener<Response> listener = new CapturingActionListener<>();
responder.accept(result, listener);
- assertNull(listener.response); // Haven't reallresponded yet
+ assertNull(listener.response); // Haven't responded yet
@SuppressWarnings({ "unchecked", "rawtypes" })
ArgumentCaptor<Consumer<Boolean>> refreshListener = ArgumentCaptor.forClass((Class) Consumer.class);