Fix DiscoveryNodeRoleIT (#43225)

The test fails if querying the roles via a transport client, since the
transport client does not have the plugin necessary to interpret the additional
role correctly. This commit adds this plugin to the transport client used.

Relates #43175
Fixes #43223
This commit is contained in:
David Turner 2019-06-14 12:27:01 +01:00 committed by GitHub
parent 7af23324e3
commit 221d23de9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -19,7 +19,6 @@
package org.elasticsearch.cluster.node;
import org.apache.lucene.util.LuceneTestCase.AwaitsFix;
import org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Settings;
@ -36,7 +35,6 @@ import static org.hamcrest.Matchers.hasItem;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.not;
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/43223")
public class DiscoveryNodeRoleIT extends ESIntegTestCase {
public static class AdditionalRolePlugin extends Plugin {
@ -74,6 +72,11 @@ public class DiscoveryNodeRoleIT extends ESIntegTestCase {
return Collections.singletonList(AdditionalRolePlugin.class);
}
@Override
protected Collection<Class<? extends Plugin>> transportClientPlugins() {
return Collections.singletonList(AdditionalRolePlugin.class);
}
public void testDefaultHasAdditionalRole() {
runTestNodeHasAdditionalRole(Settings.EMPTY);
}