Browse Source

Remove LicenseServiceClusterNotRecoveredTests (#37528)

While tests migration from Zen1 to Zen2, we've encountered this test.
This test is organized as follows:

Starts the first cluster node.
Starts the second cluster node.
Checks that license is active.
Interesting fact that adding assertLicenseActive(true) between 1
and 2 also makes the test pass.
assertLicenseActive retrieves XPackLicenseState from the nodes
and checks that active flag is set. It's set to true even before
the cluster is initialized.

So this test does not make sense.
Andrey Ershov 6 years ago
parent
commit
534ba1dd34

+ 0 - 60
x-pack/plugin/core/src/test/java/org/elasticsearch/license/LicenseServiceClusterNotRecoveredTests.java

@@ -1,60 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License;
- * you may not use this file except in compliance with the Elastic License.
- */
-package org.elasticsearch.license;
-
-import org.elasticsearch.analysis.common.CommonAnalysisPlugin;
-import org.elasticsearch.common.settings.Settings;
-import org.elasticsearch.plugins.Plugin;
-import org.elasticsearch.test.ESIntegTestCase;
-import org.elasticsearch.test.discovery.TestZenDiscovery;
-import org.elasticsearch.transport.Netty4Plugin;
-import org.elasticsearch.xpack.core.LocalStateCompositeXPackPlugin;
-
-import java.util.Arrays;
-import java.util.Collection;
-
-import static org.elasticsearch.test.ESIntegTestCase.Scope.TEST;
-
-@ESIntegTestCase.ClusterScope(scope = TEST, numDataNodes = 0, numClientNodes = 0, maxNumDataNodes = 0, transportClientRatio = 0,
-        autoMinMasterNodes = false)
-public class LicenseServiceClusterNotRecoveredTests extends AbstractLicensesIntegrationTestCase {
-
-    @Override
-    protected Settings nodeSettings(int nodeOrdinal) {
-        return nodeSettingsBuilder(nodeOrdinal).build();
-    }
-
-    @Override
-    protected boolean addMockHttpTransport() {
-        return false;
-    }
-
-    private Settings.Builder nodeSettingsBuilder(int nodeOrdinal) {
-        return Settings.builder()
-                .put(super.nodeSettings(nodeOrdinal))
-                .put("node.data", true)
-                .put(TestZenDiscovery.USE_ZEN2.getKey(), false) // this test is just weird
-                .put("resource.reload.interval.high", "500ms"); // for license mode file watcher
-    }
-
-    @Override
-    protected Collection<Class<? extends Plugin>> nodePlugins() {
-        return Arrays.asList(LocalStateCompositeXPackPlugin.class, CommonAnalysisPlugin.class, Netty4Plugin.class);
-    }
-
-    @Override
-    protected Collection<Class<? extends Plugin>> transportClientPlugins() {
-        return nodePlugins();
-    }
-
-    public void testClusterNotRecovered() throws Exception {
-        logger.info("--> start one master out of two [recovery state]");
-        internalCluster().startNode(nodeSettingsBuilder(0).put("discovery.zen.minimum_master_nodes", 2).put("node.master", true));
-        logger.info("--> start second master out of two [recovered state]");
-        internalCluster().startNode(nodeSettingsBuilder(1).put("discovery.zen.minimum_master_nodes", 2).put("node.master", true));
-        assertLicenseActive(true);
-    }
-}