[TEST] Wait for shards to be allocated before running testUpdateMappingDynamicallyWhilePercolating.

If the percolate request is executed soon enough, all shards fail and the
mapping is not actually updated.
This commit is contained in:
Adrien Grand 2014-04-15 16:20:16 +02:00
parent 9ea0e3a95b
commit 9920084ba2
1 changed files with 2 additions and 0 deletions

View File

@ -1739,6 +1739,7 @@ public class PercolatorTests extends ElasticsearchIntegrationTest {
@Test @Test
public void testUpdateMappingDynamicallyWhilePercolating() throws Exception { public void testUpdateMappingDynamicallyWhilePercolating() throws Exception {
createIndex("test"); createIndex("test");
ensureSearchable();
// percolation source // percolation source
XContentBuilder percolateDocumentSource = XContentFactory.jsonBuilder().startObject().startObject("doc") XContentBuilder percolateDocumentSource = XContentFactory.jsonBuilder().startObject().startObject("doc")
@ -1749,6 +1750,7 @@ public class PercolatorTests extends ElasticsearchIntegrationTest {
PercolateResponse response = client().preparePercolate() PercolateResponse response = client().preparePercolate()
.setIndices("test").setDocumentType("type1") .setIndices("test").setDocumentType("type1")
.setSource(percolateDocumentSource).execute().actionGet(); .setSource(percolateDocumentSource).execute().actionGet();
assertAllSuccessful(response);
assertMatchCount(response, 0l); assertMatchCount(response, 0l);
assertThat(response.getMatches(), arrayWithSize(0)); assertThat(response.getMatches(), arrayWithSize(0));