From 8007136e63f8fad31c913d7089da071bad4e2084 Mon Sep 17 00:00:00 2001 From: Areek Zillur Date: Tue, 4 Nov 2014 16:12:42 -0500 Subject: [PATCH] cleanup tests Original commit: elastic/x-pack-elasticsearch@b7733b8269994dd32004ae3fcd291ec60ed7a479 --- .../LicensesPluginsIntegrationTests.java | 24 ------------------- .../license/plugin/LicensesServiceTests.java | 11 --------- 2 files changed, 35 deletions(-) diff --git a/src/test/java/org/elasticsearch/license/plugin/LicensesPluginsIntegrationTests.java b/src/test/java/org/elasticsearch/license/plugin/LicensesPluginsIntegrationTests.java index c64a0fcc234..303ba0dc127 100644 --- a/src/test/java/org/elasticsearch/license/plugin/LicensesPluginsIntegrationTests.java +++ b/src/test/java/org/elasticsearch/license/plugin/LicensesPluginsIntegrationTests.java @@ -5,12 +5,10 @@ */ package org.elasticsearch.license.plugin; -import org.elasticsearch.common.base.Predicate; import org.elasticsearch.common.collect.Lists; import org.elasticsearch.common.settings.ImmutableSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.gateway.GatewayService; import org.elasticsearch.license.core.ESLicense; import org.elasticsearch.license.plugin.action.put.PutLicenseRequestBuilder; import org.elasticsearch.license.plugin.action.put.PutLicenseResponse; @@ -26,7 +24,6 @@ import static org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope; import static org.elasticsearch.test.ElasticsearchIntegrationTest.Scope.TEST; import static org.hamcrest.CoreMatchers.equalTo; -//@Ignore @ClusterScope(scope = TEST, numDataNodes = 0, numClientNodes = 0) public class LicensesPluginsIntegrationTests extends AbstractLicensesIntegrationTests { @@ -109,18 +106,6 @@ public class LicensesPluginsIntegrationTests extends AbstractLicensesIntegration int nNodes = randomIntBetween(2, 10); String[] nodes = startNodesWithConsumerPlugins(nNodes, trialLicenseDurationInSeconds, trialLicenseDurationInSeconds); - waitUntilClusterRecovered(); - assertThat(awaitBusy(new Predicate() { - @Override - public boolean apply(Object o) { - for (LazyLicenseRegistrationPluginService service : internalCluster().getDataNodeInstances(LazyLicenseRegistrationPluginService.class)) { - if (!service.registered.get()) { - return false; - } - } - return true; - } - }), equalTo(true)); logger.info(" --> trial license generated"); // managerService should report feature to be enabled on all data nodes assertLicenseManagerEnabledFeatureFor(FEATURE_NAME_1); @@ -210,13 +195,4 @@ public class LicensesPluginsIntegrationTests extends AbstractLicensesIntegration assertThat(putLicenseResponse.isAcknowledged(), equalTo(true)); assertThat(putLicenseResponse.status(), equalTo(LicensesStatus.VALID)); } - - private void waitUntilClusterRecovered() throws InterruptedException { - assertThat(awaitBusy(new Predicate() { - @Override - public boolean apply(Object o) { - return !clusterService().state().blocks().hasGlobalBlock(GatewayService.STATE_NOT_RECOVERED_BLOCK); - } - }), equalTo(true)); - } } diff --git a/src/test/java/org/elasticsearch/license/plugin/LicensesServiceTests.java b/src/test/java/org/elasticsearch/license/plugin/LicensesServiceTests.java index 12e6e0ec11a..0ad5558433e 100644 --- a/src/test/java/org/elasticsearch/license/plugin/LicensesServiceTests.java +++ b/src/test/java/org/elasticsearch/license/plugin/LicensesServiceTests.java @@ -314,17 +314,6 @@ public class LicensesServiceTests extends AbstractLicensesIntegrationTests { // invoke clusterChanged event to flush out pendingRegistration LicensesService licensesService = (LicensesService) clientService; - /* - try { - assertThat(awaitBusy(new Predicate() { - @Override - public boolean apply(Object o) { - return !clusterService().state().blocks().hasGlobalBlock(GatewayService.STATE_NOT_RECOVERED_BLOCK); - } - }), equalTo(true)); - } catch (InterruptedException e) { - logger.error("Exception while trying to registerWithTrialLicense", e); - }*/ ClusterChangedEvent event = new ClusterChangedEvent("", clusterService().state(), clusterService().state()); licensesService.clusterChanged(event); }