test: verify whether templates exist in an assertBusy(...)
It may take a few clicks before the templates are added. Waiting for started doesn't guarantee that the index templates have been added. Original commit: elastic/x-pack-elasticsearch@ee94b740a8
This commit is contained in:
parent
792a821d1a
commit
0701f7bb18
|
@ -574,12 +574,14 @@ public abstract class AbstractWatcherIntegrationTestCase extends ESIntegTestCase
|
|||
});
|
||||
|
||||
// Verify that the index templates exist:
|
||||
assertBusy(() -> {
|
||||
GetIndexTemplatesResponse response = client().admin().indices().prepareGetTemplates(HISTORY_TEMPLATE_NAME).get();
|
||||
assertThat("[" + HISTORY_TEMPLATE_NAME + "] is missing", response.getIndexTemplates().size(), equalTo(1));
|
||||
response = client().admin().indices().prepareGetTemplates(TRIGGERED_TEMPLATE_NAME).get();
|
||||
assertThat("[" + TRIGGERED_TEMPLATE_NAME + "] is missing", response.getIndexTemplates().size(), equalTo(1));
|
||||
response = client().admin().indices().prepareGetTemplates(WATCHES_TEMPLATE_NAME).get();
|
||||
assertThat("[" + WATCHES_TEMPLATE_NAME + "] is missing", response.getIndexTemplates().size(), equalTo(1));
|
||||
});
|
||||
}
|
||||
|
||||
protected void ensureLicenseEnabled() throws Exception {
|
||||
|
|
Loading…
Reference in New Issue