Apache Lucene open-source search software
SOLR-12028: BadApple and AwaitsFix annotations usage.
Erick Erickson3235c61e7775
diff --git a/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java b/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.javaindex a34170accf3..0d689bddd7e 100644--- a/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java+++ b/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java@@ -184,7 +184,7 @@ public class BasicDistributedZkTest extends AbstractFullDistribZkTestBase {@Test@ShardsFixed(num = 4)- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // annotated on: 24-Dec-2018+ // commented out on: 17-Feb-2019 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // annotated on: 24-Dec-2018public void test() throws Exception {// setLoggingLevel(null);diff --git a/solr/core/src/test/org/apache/solr/cloud/DeleteReplicaTest.java b/solr/core/src/test/org/apache/solr/cloud/DeleteReplicaTest.javaindex 9e62a387f9d..8249f4d931b 100644--- a/solr/core/src/test/org/apache/solr/cloud/DeleteReplicaTest.java+++ b/solr/core/src/test/org/apache/solr/cloud/DeleteReplicaTest.java@@ -177,7 +177,7 @@ public class DeleteReplicaTest extends SolrCloudTestCase {}@Test- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // annotated on: 24-Dec-2018+ // commented out on: 17-Feb-2019 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // annotated on: 24-Dec-2018public void deleteReplicaByCountForAllShards() throws Exception {final String collectionName = "deleteByCountNew";@@ -251,7 +251,7 @@ public class DeleteReplicaTest extends SolrCloudTestCase {@Test@Slow- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // annotated on: 24-Dec-2018+ // commented out on: 17-Feb-2019 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // annotated on: 24-Dec-2018public void raceConditionOnDeleteAndRegisterReplica() throws Exception {raceConditionOnDeleteAndRegisterReplica("false");CollectionAdminRequest.setClusterProperty(ZkStateReader.LEGACY_CLOUD, null).process(cluster.getSolrClient());@@ -259,13 +259,13 @@ public class DeleteReplicaTest extends SolrCloudTestCase {@Test@Slow- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // annotated on: 24-Dec-2018+ // commented out on: 17-Feb-2019 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // annotated on: 24-Dec-2018public void raceConditionOnDeleteAndRegisterReplicaLegacy() throws Exception {raceConditionOnDeleteAndRegisterReplica("true");CollectionAdminRequest.setClusterProperty(ZkStateReader.LEGACY_CLOUD, null).process(cluster.getSolrClient());}- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // annotated on: 24-Dec-2018+ // commented out on: 17-Feb-2019 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // annotated on: 24-Dec-2018public void raceConditionOnDeleteAndRegisterReplica(String legacyCloud) throws Exception {CollectionAdminRequest.setClusterProperty(ZkStateReader.LEGACY_CLOUD, legacyCloud).process(cluster.getSolrClient());diff --git a/solr/core/src/test/org/apache/solr/cloud/MoveReplicaTest.java b/solr/core/src/test/org/apache/solr/cloud/MoveReplicaTest.javaindex a8797b6ccc8..e0b71c48f0c 100644--- a/solr/core/src/test/org/apache/solr/cloud/MoveReplicaTest.java+++ b/solr/core/src/test/org/apache/solr/cloud/MoveReplicaTest.java@@ -97,7 +97,7 @@ public class MoveReplicaTest extends SolrCloudTestCase {}@Test- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // annotated on: 24-Dec-2018+ // commented out on: 17-Feb-2019 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // annotated on: 24-Dec-2018public void test() throws Exception {String coll = getTestClass().getSimpleName() + "_coll_" + inPlaceMove;log.info("total_jettys: " + cluster.getJettySolrRunners().size());@@ -240,7 +240,7 @@ public class MoveReplicaTest extends SolrCloudTestCase {@Test// 12-Jun-2018 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 17-Mar-2018 This JIRA is fixed, but this test still fails//17-Aug-2018 commented @LuceneTestCase.BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 2-Aug-2018- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // annotated on: 24-Dec-2018+ // commented out on: 17-Feb-2019 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // annotated on: 24-Dec-2018public void testFailedMove() throws Exception {String coll = getTestClass().getSimpleName() + "_failed_coll_" + inPlaceMove;int REPLICATION = 2;diff --git a/solr/core/src/test/org/apache/solr/cloud/TestCloudRecovery.java b/solr/core/src/test/org/apache/solr/cloud/TestCloudRecovery.javaindex 8512bcbd334..6204003075e 100644--- a/solr/core/src/test/org/apache/solr/cloud/TestCloudRecovery.java+++ b/solr/core/src/test/org/apache/solr/cloud/TestCloudRecovery.java@@ -160,7 +160,7 @@ public class TestCloudRecovery extends SolrCloudTestCase {}@Test- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 14-Oct-2018+ // commented out on: 17-Feb-2019 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 14-Oct-2018public void corruptedLogTest() throws Exception {AtomicInteger countReplayLog = new AtomicInteger(0);DirectUpdateHandler2.commitOnClose = false;diff --git a/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudClusterSSL.java b/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudClusterSSL.javaindex db98be0430f..29bdfaec01c 100644--- a/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudClusterSSL.java+++ b/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudClusterSSL.java@@ -33,7 +33,6 @@ import org.apache.http.impl.client.CloseableHttpClient;import org.apache.http.impl.client.HttpClientBuilder;import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;import org.apache.lucene.util.Constants;-import org.apache.lucene.util.LuceneTestCase;import org.apache.lucene.util.TestRuleRestoreSystemProperties;import org.apache.solr.SolrTestCaseJ4;@@ -140,7 +139,7 @@ public class TestMiniSolrCloudClusterSSL extends SolrTestCaseJ4 {checkClusterWithNodeReplacement(sslConfig);}- @LuceneTestCase.BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 2-Aug-2018+ // commented out on: 17-Feb-2019 @LuceneTestCase.BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 2-Aug-2018public void testSslWithCheckPeerName() throws Exception {final SSLTestConfig sslConfig = new SSLTestConfig(true, false, true);HttpClientUtil.setSchemaRegistryProvider(sslConfig.buildClientSchemaRegistryProvider());diff --git a/solr/core/src/test/org/apache/solr/cloud/TestPullReplica.java b/solr/core/src/test/org/apache/solr/cloud/TestPullReplica.javaindex 97bde931f16..f90d0add0cb 100644--- a/solr/core/src/test/org/apache/solr/cloud/TestPullReplica.java+++ b/solr/core/src/test/org/apache/solr/cloud/TestPullReplica.java@@ -130,7 +130,7 @@ public class TestPullReplica extends SolrCloudTestCase {}@Repeat(iterations=2) // 2 times to make sure cleanup is complete and we can create the same collection- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 21-May-2018+ // commented out on: 17-Feb-2019 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 21-May-2018public void testCreateDelete() throws Exception {try {switch (random().nextInt(3)) {diff --git a/solr/core/src/test/org/apache/solr/cloud/TestSkipOverseerOperations.java b/solr/core/src/test/org/apache/solr/cloud/TestSkipOverseerOperations.javaindex e44115e2041..73bf698df78 100644--- a/solr/core/src/test/org/apache/solr/cloud/TestSkipOverseerOperations.java+++ b/solr/core/src/test/org/apache/solr/cloud/TestSkipOverseerOperations.java@@ -126,7 +126,7 @@ public class TestSkipOverseerOperations extends SolrCloudTestCase {}@Test- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // added 20-Sep-2018+ // commented out on: 17-Feb-2019 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // added 20-Sep-2018public void testSkipDownOperations() throws Exception {String overseerLeader = getOverseerLeader();List<JettySolrRunner> notOverseerNodes = cluster.getJettySolrRunners()diff --git a/solr/core/src/test/org/apache/solr/cloud/TestStressInPlaceUpdates.java b/solr/core/src/test/org/apache/solr/cloud/TestStressInPlaceUpdates.javaindex feeebaa706d..c9fcaf7a503 100644--- a/solr/core/src/test/org/apache/solr/cloud/TestStressInPlaceUpdates.java+++ b/solr/core/src/test/org/apache/solr/cloud/TestStressInPlaceUpdates.java@@ -93,7 +93,7 @@ public class TestStressInPlaceUpdates extends AbstractFullDistribZkTestBase {@Test@ShardsFixed(num = 3)- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 09-Apr-2018+ // commented out on: 17-Feb-2019 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 09-Apr-2018public void stressTest() throws Exception {waitForRecoveriesToFinish(true);diff --git a/solr/core/src/test/org/apache/solr/cloud/TestTlogReplica.java b/solr/core/src/test/org/apache/solr/cloud/TestTlogReplica.javaindex 0318b1eb120..062dac4fedb 100644--- a/solr/core/src/test/org/apache/solr/cloud/TestTlogReplica.java+++ b/solr/core/src/test/org/apache/solr/cloud/TestTlogReplica.java@@ -150,7 +150,7 @@ public class TestTlogReplica extends SolrCloudTestCase {}@Repeat(iterations=2) // 2 times to make sure cleanup is complete and we can create the same collection- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // added 09-Aug-2018+ // commented out on: 17-Feb-2019 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // added 09-Aug-2018public void testCreateDelete() throws Exception {try {switch (random().nextInt(3)) {diff --git a/solr/core/src/test/org/apache/solr/cloud/TestWithCollection.java b/solr/core/src/test/org/apache/solr/cloud/TestWithCollection.javaindex 512207ac1a9..5d7aa9fc5f7 100644--- a/solr/core/src/test/org/apache/solr/cloud/TestWithCollection.java+++ b/solr/core/src/test/org/apache/solr/cloud/TestWithCollection.java@@ -239,7 +239,7 @@ public class TestWithCollection extends SolrCloudTestCase {}@Test- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // added 20-Sep-2018+ // commented out on: 17-Feb-2019 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // added 20-Sep-2018public void testAddReplicaWithPolicy() throws Exception {String prefix = "testAddReplicaWithPolicy";String xyz = prefix + "_xyz";diff --git a/solr/core/src/test/org/apache/solr/cloud/ZkShardTermsTest.java b/solr/core/src/test/org/apache/solr/cloud/ZkShardTermsTest.javaindex 1745ae4f87d..5c9fea0a7e1 100644--- a/solr/core/src/test/org/apache/solr/cloud/ZkShardTermsTest.java+++ b/solr/core/src/test/org/apache/solr/cloud/ZkShardTermsTest.java@@ -1,316 +1,316 @@-/*- * Licensed to the Apache Software Foundation (ASF) under one or more- * contributor license agreements. See the NOTICE file distributed with- * this work for additional information regarding copyright ownership.- * The ASF licenses this file to You under the Apache License, Version 2.0- * (the "License"); you may not use this file except in compliance with- * the License. You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--package org.apache.solr.cloud;--import java.io.IOException;-import java.lang.invoke.MethodHandles;-import java.util.ArrayList;-import java.util.Arrays;-import java.util.Collections;-import java.util.HashMap;-import java.util.List;-import java.util.Map;-import java.util.Objects;-import java.util.concurrent.TimeUnit;-import java.util.concurrent.atomic.AtomicBoolean;-import java.util.concurrent.atomic.AtomicInteger;-import java.util.function.Supplier;--import org.apache.solr.client.solrj.SolrServerException;-import org.apache.solr.client.solrj.request.CollectionAdminRequest;-import org.apache.solr.common.util.TimeSource;-import org.apache.solr.util.TimeOut;-import org.junit.BeforeClass;-import org.junit.Test;-import org.slf4j.Logger;-import org.slf4j.LoggerFactory;--public class ZkShardTermsTest extends SolrCloudTestCase {-- private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());-- @BeforeClass- public static void setupCluster() throws Exception {- configureCluster(1)- .addConfig("conf1", TEST_PATH().resolve("configsets").resolve("cloud-minimal").resolve("conf"))- .configure();- }-- @Test- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // added 15-Sep-2018- public void testParticipationOfReplicas() throws IOException, SolrServerException, InterruptedException {- String collection = "collection1";- try (ZkShardTerms zkShardTerms = new ZkShardTerms(collection, "shard2", cluster.getZkClient())) {- zkShardTerms.registerTerm("replica1");- zkShardTerms.registerTerm("replica2");- zkShardTerms.ensureTermsIsHigher("replica1", Collections.singleton("replica2"));- }-- // When new collection is created, the old term nodes will be removed- CollectionAdminRequest.createCollection(collection, 2, 2)- .setCreateNodeSet(cluster.getJettySolrRunner(0).getNodeName())- .setMaxShardsPerNode(1000)- .process(cluster.getSolrClient());- try (ZkShardTerms zkShardTerms = new ZkShardTerms(collection, "shard1", cluster.getZkClient())) {- waitFor(2, () -> zkShardTerms.getTerms().size());- assertArrayEquals(new Long[]{0L, 0L}, zkShardTerms.getTerms().values().toArray(new Long[2]));- }- try (ZkShardTerms zkShardTerms = new ZkShardTerms(collection, "shard2", cluster.getZkClient())) {- waitFor(2, () -> zkShardTerms.getTerms().size());- assertArrayEquals(new Long[]{0L, 0L}, zkShardTerms.getTerms().values().toArray(new Long[2]));- }- }-- @Test- public void testRecoveringFlag() {- String collection = "recoveringFlag";- try (ZkShardTerms zkShardTerms = new ZkShardTerms(collection, "shard1", cluster.getZkClient())) {- // List all possible orders of ensureTermIsHigher, startRecovering, doneRecovering- zkShardTerms.registerTerm("replica1");- zkShardTerms.registerTerm("replica2");-- // normal case when leader failed to send an update to replica- zkShardTerms.ensureTermsIsHigher("replica1", Collections.singleton("replica2"));- zkShardTerms.startRecovering("replica2");- assertEquals(zkShardTerms.getTerm("replica2"), 1);- assertEquals(zkShardTerms.getTerm("replica2_recovering"), 0);-- zkShardTerms.doneRecovering("replica2");- assertEquals(zkShardTerms.getTerm("replica1"), 1);- assertEquals(zkShardTerms.getTerm("replica2"), 1);- assertEquals(zkShardTerms.getTerm("replica2_recovering"), -1);-- zkShardTerms.ensureTermsIsHigher("replica1", Collections.singleton("replica2"));- assertEquals(zkShardTerms.getTerm("replica1"), 2);- assertEquals(zkShardTerms.getTerm("replica2"), 1);- assertEquals(zkShardTerms.getTerm("replica2_recovering"), -1);-- zkShardTerms.startRecovering("replica2");- assertEquals(zkShardTerms.getTerm("replica2"), 2);- assertEquals(zkShardTerms.getTerm("replica2_recovering"), 1);-- zkShardTerms.ensureTermsIsHigher("replica1", Collections.singleton("replica2"));- assertEquals(zkShardTerms.getTerm("replica1"), 3);- assertEquals(zkShardTerms.getTerm("replica2"), 2);- assertEquals(zkShardTerms.getTerm("replica2_recovering"), 1);-- zkShardTerms.doneRecovering("replica2");- assertEquals(zkShardTerms.getTerm("replica2"), 2);- assertEquals(zkShardTerms.getTerm("replica2_recovering"), -1);-- zkShardTerms.startRecovering("replica2");- zkShardTerms.doneRecovering("replica2");-- zkShardTerms.ensureTermsIsHigher("replica1", Collections.singleton("replica2"));- zkShardTerms.startRecovering("replica2");- zkShardTerms.ensureTermsIsHigher("replica1", Collections.singleton("replica2"));- zkShardTerms.startRecovering("replica2");- assertEquals(zkShardTerms.getTerm("replica1"), 5);- assertEquals(zkShardTerms.getTerm("replica2"), 5);- assertEquals(zkShardTerms.getTerm("replica2_recovering"), 3);- zkShardTerms.doneRecovering("replica2");- assertEquals(zkShardTerms.getTerm("replica2_recovering"), -1);-- }- }-- public void testRegisterTerm() throws InterruptedException {- String collection = "registerTerm";- ZkShardTerms rep1Terms = new ZkShardTerms(collection, "shard1", cluster.getZkClient());- ZkShardTerms rep2Terms = new ZkShardTerms(collection, "shard1", cluster.getZkClient());-- rep1Terms.registerTerm("rep1");- rep2Terms.registerTerm("rep2");- try (ZkShardTerms zkShardTerms = new ZkShardTerms(collection, "shard1", cluster.getZkClient())) {- assertEquals(0L, zkShardTerms.getTerm("rep1"));- assertEquals(0L, zkShardTerms.getTerm("rep2"));- }- waitFor(2, () -> rep1Terms.getTerms().size());- rep1Terms.ensureTermsIsHigher("rep1", Collections.singleton("rep2"));- assertEquals(1L, rep1Terms.getTerm("rep1"));- assertEquals(0L, rep1Terms.getTerm("rep2"));-- // assert registerTerm does not override current value- rep1Terms.registerTerm("rep1");- assertEquals(1L, rep1Terms.getTerm("rep1"));-- waitFor(1L, () -> rep2Terms.getTerm("rep1"));- rep2Terms.setTermEqualsToLeader("rep2");- assertEquals(1L, rep2Terms.getTerm("rep2"));- rep2Terms.registerTerm("rep2");- assertEquals(1L, rep2Terms.getTerm("rep2"));-- // zkShardTerms must stay updated by watcher- Map<String, Long> expectedTerms = new HashMap<>();- expectedTerms.put("rep1", 1L);- expectedTerms.put("rep2", 1L);-- TimeOut timeOut = new TimeOut(10, TimeUnit.SECONDS, new TimeSource.CurrentTimeSource());- while (!timeOut.hasTimedOut()) {- if (Objects.equals(expectedTerms, rep1Terms.getTerms()) && Objects.equals(expectedTerms, rep2Terms.getTerms())) break;- }- if (timeOut.hasTimedOut()) fail("Expected zkShardTerms must stay updated");-- rep1Terms.close();- rep2Terms.close();- }-- @Test- public void testRaceConditionOnUpdates() throws InterruptedException {- String collection = "raceConditionOnUpdates";- List<String> replicas = Arrays.asList("rep1", "rep2", "rep3", "rep4");- for (String replica : replicas) {- try (ZkShardTerms zkShardTerms = new ZkShardTerms(collection, "shard1", cluster.getZkClient())) {- zkShardTerms.registerTerm(replica);- }- }-- List<String> failedReplicas = new ArrayList<>(replicas);- Collections.shuffle(failedReplicas, random());- while (failedReplicas.size() > 2) {- failedReplicas.remove(0);- }- AtomicBoolean stop = new AtomicBoolean(false);- Thread[] threads = new Thread[failedReplicas.size()];- for (int i = 0; i < failedReplicas.size(); i++) {- String replica = failedReplicas.get(i);- threads[i] = new Thread(() -> {- try (ZkShardTerms zkShardTerms = new ZkShardTerms(collection, "shard1", cluster.getZkClient())) {- while (!stop.get()) {- try {- Thread.sleep(random().nextInt(200));- zkShardTerms.setTermEqualsToLeader(replica);- } catch (InterruptedException e) {- e.printStackTrace();- }- }- }- });- threads[i].start();- }-- long maxTerm = 0;- try (ZkShardTerms shardTerms = new ZkShardTerms(collection, "shard1", cluster.getZkClient())) {- shardTerms.registerTerm("leader");- TimeOut timeOut = new TimeOut(10, TimeUnit.SECONDS, new TimeSource.CurrentTimeSource());- while (!timeOut.hasTimedOut()) {- maxTerm++;- assertEquals(shardTerms.getTerms().get("leader"), Collections.max(shardTerms.getTerms().values()));- Thread.sleep(100);- }- assertTrue(maxTerm >= Collections.max(shardTerms.getTerms().values()));- }- stop.set(true);- for (Thread thread : threads) {- thread.join();- }- }-- public void testCoreTermWatcher() throws InterruptedException {- String collection = "coreTermWatcher";- ZkShardTerms leaderTerms = new ZkShardTerms(collection, "shard1", cluster.getZkClient());- leaderTerms.registerTerm("leader");- ZkShardTerms replicaTerms = new ZkShardTerms(collection, "shard1", cluster.getZkClient());- AtomicInteger count = new AtomicInteger(0);- // this will get called for almost 3 times- ZkShardTerms.CoreTermWatcher watcher = terms -> count.incrementAndGet() < 3;- replicaTerms.addListener(watcher);- replicaTerms.registerTerm("replica");- waitFor(1, count::get);- leaderTerms.ensureTermsIsHigher("leader", Collections.singleton("replica"));- waitFor(2, count::get);- replicaTerms.setTermEqualsToLeader("replica");- waitFor(3, count::get);- assertEquals(0, replicaTerms.getNumListeners());-- leaderTerms.close();- replicaTerms.close();- }-- public void testEnsureTermsIsHigher() {- Map<String, Long> map = new HashMap<>();- map.put("leader", 0L);- ZkShardTerms.Terms terms = new ZkShardTerms.Terms(map, 0);- terms = terms.increaseTerms("leader", Collections.singleton("replica"));- assertEquals(1L, terms.getTerm("leader").longValue());- }-- public void testSetTermToZero() {- String collection = "setTermToZero";- ZkShardTerms terms = new ZkShardTerms(collection, "shard1", cluster.getZkClient());- terms.registerTerm("leader");- terms.registerTerm("replica");- terms.ensureTermsIsHigher("leader", Collections.singleton("replica"));- assertEquals(1L, terms.getTerm("leader"));- terms.setTermToZero("leader");- assertEquals(0L, terms.getTerm("leader"));- terms.close();- }-- public void testReplicaCanBecomeLeader() throws InterruptedException {- String collection = "replicaCanBecomeLeader";- ZkShardTerms leaderTerms = new ZkShardTerms(collection, "shard1", cluster.getZkClient());- ZkShardTerms replicaTerms = new ZkShardTerms(collection, "shard1", cluster.getZkClient());- leaderTerms.registerTerm("leader");- replicaTerms.registerTerm("replica");-- leaderTerms.ensureTermsIsHigher("leader", Collections.singleton("replica"));- waitFor(false, () -> replicaTerms.canBecomeLeader("replica"));- waitFor(true, () -> leaderTerms.skipSendingUpdatesTo("replica"));-- replicaTerms.startRecovering("replica");- waitFor(false, () -> replicaTerms.canBecomeLeader("replica"));- waitFor(false, () -> leaderTerms.skipSendingUpdatesTo("replica"));-- replicaTerms.doneRecovering("replica");- waitFor(true, () -> replicaTerms.canBecomeLeader("replica"));- waitFor(false, () -> leaderTerms.skipSendingUpdatesTo("replica"));-- leaderTerms.close();- replicaTerms.close();- }-- public void testSetTermEqualsToLeader() throws InterruptedException {- String collection = "setTermEqualsToLeader";- ZkShardTerms leaderTerms = new ZkShardTerms(collection, "shard1", cluster.getZkClient());- ZkShardTerms replicaTerms = new ZkShardTerms(collection, "shard1", cluster.getZkClient());- leaderTerms.registerTerm("leader");- replicaTerms.registerTerm("replica");-- leaderTerms.ensureTermsIsHigher("leader", Collections.singleton("replica"));- waitFor(false, () -> replicaTerms.canBecomeLeader("replica"));- waitFor(true, () -> leaderTerms.skipSendingUpdatesTo("replica"));-- replicaTerms.setTermEqualsToLeader("replica");- waitFor(true, () -> replicaTerms.canBecomeLeader("replica"));- waitFor(false, () -> leaderTerms.skipSendingUpdatesTo("replica"));-- leaderTerms.close();- replicaTerms.close();- }-- private <T> void waitFor(T expected, Supplier<T> supplier) throws InterruptedException {- TimeOut timeOut = new TimeOut(10, TimeUnit.SECONDS, new TimeSource.CurrentTimeSource());- while (!timeOut.hasTimedOut()) {- if (expected == supplier.get()) return;- Thread.sleep(100);- }- assertEquals(expected, supplier.get());- }--}+/*+ * Licensed to the Apache Software Foundation (ASF) under one or more+ * contributor license agreements. See the NOTICE file distributed with+ * this work for additional information regarding copyright ownership.+ * The ASF licenses this file to You under the Apache License, Version 2.0+ * (the "License"); you may not use this file except in compliance with+ * the License. You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */++package org.apache.solr.cloud;++import java.io.IOException;+import java.lang.invoke.MethodHandles;+import java.util.ArrayList;+import java.util.Arrays;+import java.util.Collections;+import java.util.HashMap;+import java.util.List;+import java.util.Map;+import java.util.Objects;+import java.util.concurrent.TimeUnit;+import java.util.concurrent.atomic.AtomicBoolean;+import java.util.concurrent.atomic.AtomicInteger;+import java.util.function.Supplier;++import org.apache.solr.client.solrj.SolrServerException;+import org.apache.solr.client.solrj.request.CollectionAdminRequest;+import org.apache.solr.common.util.TimeSource;+import org.apache.solr.util.TimeOut;+import org.junit.BeforeClass;+import org.junit.Test;+import org.slf4j.Logger;+import org.slf4j.LoggerFactory;++public class ZkShardTermsTest extends SolrCloudTestCase {++ private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());++ @BeforeClass+ public static void setupCluster() throws Exception {+ configureCluster(1)+ .addConfig("conf1", TEST_PATH().resolve("configsets").resolve("cloud-minimal").resolve("conf"))+ .configure();+ }++ @Test+ // commented out on: 17-Feb-2019 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // added 15-Sep-2018+ public void testParticipationOfReplicas() throws IOException, SolrServerException, InterruptedException {+ String collection = "collection1";+ try (ZkShardTerms zkShardTerms = new ZkShardTerms(collection, "shard2", cluster.getZkClient())) {+ zkShardTerms.registerTerm("replica1");+ zkShardTerms.registerTerm("replica2");+ zkShardTerms.ensureTermsIsHigher("replica1", Collections.singleton("replica2"));+ }++ // When new collection is created, the old term nodes will be removed+ CollectionAdminRequest.createCollection(collection, 2, 2)+ .setCreateNodeSet(cluster.getJettySolrRunner(0).getNodeName())+ .setMaxShardsPerNode(1000)+ .process(cluster.getSolrClient());+ try (ZkShardTerms zkShardTerms = new ZkShardTerms(collection, "shard1", cluster.getZkClient())) {+ waitFor(2, () -> zkShardTerms.getTerms().size());+ assertArrayEquals(new Long[]{0L, 0L}, zkShardTerms.getTerms().values().toArray(new Long[2]));+ }+ try (ZkShardTerms zkShardTerms = new ZkShardTerms(collection, "shard2", cluster.getZkClient())) {+ waitFor(2, () -> zkShardTerms.getTerms().size());+ assertArrayEquals(new Long[]{0L, 0L}, zkShardTerms.getTerms().values().toArray(new Long[2]));+ }+ }++ @Test+ public void testRecoveringFlag() {+ String collection = "recoveringFlag";+ try (ZkShardTerms zkShardTerms = new ZkShardTerms(collection, "shard1", cluster.getZkClient())) {+ // List all possible orders of ensureTermIsHigher, startRecovering, doneRecovering+ zkShardTerms.registerTerm("replica1");+ zkShardTerms.registerTerm("replica2");++ // normal case when leader failed to send an update to replica+ zkShardTerms.ensureTermsIsHigher("replica1", Collections.singleton("replica2"));+ zkShardTerms.startRecovering("replica2");+ assertEquals(zkShardTerms.getTerm("replica2"), 1);+ assertEquals(zkShardTerms.getTerm("replica2_recovering"), 0);++ zkShardTerms.doneRecovering("replica2");+ assertEquals(zkShardTerms.getTerm("replica1"), 1);+ assertEquals(zkShardTerms.getTerm("replica2"), 1);+ assertEquals(zkShardTerms.getTerm("replica2_recovering"), -1);++ zkShardTerms.ensureTermsIsHigher("replica1", Collections.singleton("replica2"));+ assertEquals(zkShardTerms.getTerm("replica1"), 2);+ assertEquals(zkShardTerms.getTerm("replica2"), 1);+ assertEquals(zkShardTerms.getTerm("replica2_recovering"), -1);++ zkShardTerms.startRecovering("replica2");+ assertEquals(zkShardTerms.getTerm("replica2"), 2);+ assertEquals(zkShardTerms.getTerm("replica2_recovering"), 1);++ zkShardTerms.ensureTermsIsHigher("replica1", Collections.singleton("replica2"));+ assertEquals(zkShardTerms.getTerm("replica1"), 3);+ assertEquals(zkShardTerms.getTerm("replica2"), 2);+ assertEquals(zkShardTerms.getTerm("replica2_recovering"), 1);++ zkShardTerms.doneRecovering("replica2");+ assertEquals(zkShardTerms.getTerm("replica2"), 2);+ assertEquals(zkShardTerms.getTerm("replica2_recovering"), -1);++ zkShardTerms.startRecovering("replica2");+ zkShardTerms.doneRecovering("replica2");++ zkShardTerms.ensureTermsIsHigher("replica1", Collections.singleton("replica2"));+ zkShardTerms.startRecovering("replica2");+ zkShardTerms.ensureTermsIsHigher("replica1", Collections.singleton("replica2"));+ zkShardTerms.startRecovering("replica2");+ assertEquals(zkShardTerms.getTerm("replica1"), 5);+ assertEquals(zkShardTerms.getTerm("replica2"), 5);+ assertEquals(zkShardTerms.getTerm("replica2_recovering"), 3);+ zkShardTerms.doneRecovering("replica2");+ assertEquals(zkShardTerms.getTerm("replica2_recovering"), -1);++ }+ }++ public void testRegisterTerm() throws InterruptedException {+ String collection = "registerTerm";+ ZkShardTerms rep1Terms = new ZkShardTerms(collection, "shard1", cluster.getZkClient());+ ZkShardTerms rep2Terms = new ZkShardTerms(collection, "shard1", cluster.getZkClient());++ rep1Terms.registerTerm("rep1");+ rep2Terms.registerTerm("rep2");+ try (ZkShardTerms zkShardTerms = new ZkShardTerms(collection, "shard1", cluster.getZkClient())) {+ assertEquals(0L, zkShardTerms.getTerm("rep1"));+ assertEquals(0L, zkShardTerms.getTerm("rep2"));+ }+ waitFor(2, () -> rep1Terms.getTerms().size());+ rep1Terms.ensureTermsIsHigher("rep1", Collections.singleton("rep2"));+ assertEquals(1L, rep1Terms.getTerm("rep1"));+ assertEquals(0L, rep1Terms.getTerm("rep2"));++ // assert registerTerm does not override current value+ rep1Terms.registerTerm("rep1");+ assertEquals(1L, rep1Terms.getTerm("rep1"));++ waitFor(1L, () -> rep2Terms.getTerm("rep1"));+ rep2Terms.setTermEqualsToLeader("rep2");+ assertEquals(1L, rep2Terms.getTerm("rep2"));+ rep2Terms.registerTerm("rep2");+ assertEquals(1L, rep2Terms.getTerm("rep2"));++ // zkShardTerms must stay updated by watcher+ Map<String, Long> expectedTerms = new HashMap<>();+ expectedTerms.put("rep1", 1L);+ expectedTerms.put("rep2", 1L);++ TimeOut timeOut = new TimeOut(10, TimeUnit.SECONDS, new TimeSource.CurrentTimeSource());+ while (!timeOut.hasTimedOut()) {+ if (Objects.equals(expectedTerms, rep1Terms.getTerms()) && Objects.equals(expectedTerms, rep2Terms.getTerms())) break;+ }+ if (timeOut.hasTimedOut()) fail("Expected zkShardTerms must stay updated");++ rep1Terms.close();+ rep2Terms.close();+ }++ @Test+ public void testRaceConditionOnUpdates() throws InterruptedException {+ String collection = "raceConditionOnUpdates";+ List<String> replicas = Arrays.asList("rep1", "rep2", "rep3", "rep4");+ for (String replica : replicas) {+ try (ZkShardTerms zkShardTerms = new ZkShardTerms(collection, "shard1", cluster.getZkClient())) {+ zkShardTerms.registerTerm(replica);+ }+ }++ List<String> failedReplicas = new ArrayList<>(replicas);+ Collections.shuffle(failedReplicas, random());+ while (failedReplicas.size() > 2) {+ failedReplicas.remove(0);+ }+ AtomicBoolean stop = new AtomicBoolean(false);+ Thread[] threads = new Thread[failedReplicas.size()];+ for (int i = 0; i < failedReplicas.size(); i++) {+ String replica = failedReplicas.get(i);+ threads[i] = new Thread(() -> {+ try (ZkShardTerms zkShardTerms = new ZkShardTerms(collection, "shard1", cluster.getZkClient())) {+ while (!stop.get()) {+ try {+ Thread.sleep(random().nextInt(200));+ zkShardTerms.setTermEqualsToLeader(replica);+ } catch (InterruptedException e) {+ e.printStackTrace();+ }+ }+ }+ });+ threads[i].start();+ }++ long maxTerm = 0;+ try (ZkShardTerms shardTerms = new ZkShardTerms(collection, "shard1", cluster.getZkClient())) {+ shardTerms.registerTerm("leader");+ TimeOut timeOut = new TimeOut(10, TimeUnit.SECONDS, new TimeSource.CurrentTimeSource());+ while (!timeOut.hasTimedOut()) {+ maxTerm++;+ assertEquals(shardTerms.getTerms().get("leader"), Collections.max(shardTerms.getTerms().values()));+ Thread.sleep(100);+ }+ assertTrue(maxTerm >= Collections.max(shardTerms.getTerms().values()));+ }+ stop.set(true);+ for (Thread thread : threads) {+ thread.join();+ }+ }++ public void testCoreTermWatcher() throws InterruptedException {+ String collection = "coreTermWatcher";+ ZkShardTerms leaderTerms = new ZkShardTerms(collection, "shard1", cluster.getZkClient());+ leaderTerms.registerTerm("leader");+ ZkShardTerms replicaTerms = new ZkShardTerms(collection, "shard1", cluster.getZkClient());+ AtomicInteger count = new AtomicInteger(0);+ // this will get called for almost 3 times+ ZkShardTerms.CoreTermWatcher watcher = terms -> count.incrementAndGet() < 3;+ replicaTerms.addListener(watcher);+ replicaTerms.registerTerm("replica");+ waitFor(1, count::get);+ leaderTerms.ensureTermsIsHigher("leader", Collections.singleton("replica"));+ waitFor(2, count::get);+ replicaTerms.setTermEqualsToLeader("replica");+ waitFor(3, count::get);+ assertEquals(0, replicaTerms.getNumListeners());++ leaderTerms.close();+ replicaTerms.close();+ }++ public void testEnsureTermsIsHigher() {+ Map<String, Long> map = new HashMap<>();+ map.put("leader", 0L);+ ZkShardTerms.Terms terms = new ZkShardTerms.Terms(map, 0);+ terms = terms.increaseTerms("leader", Collections.singleton("replica"));+ assertEquals(1L, terms.getTerm("leader").longValue());+ }++ public void testSetTermToZero() {+ String collection = "setTermToZero";+ ZkShardTerms terms = new ZkShardTerms(collection, "shard1", cluster.getZkClient());+ terms.registerTerm("leader");+ terms.registerTerm("replica");+ terms.ensureTermsIsHigher("leader", Collections.singleton("replica"));+ assertEquals(1L, terms.getTerm("leader"));+ terms.setTermToZero("leader");+ assertEquals(0L, terms.getTerm("leader"));+ terms.close();+ }++ public void testReplicaCanBecomeLeader() throws InterruptedException {+ String collection = "replicaCanBecomeLeader";+ ZkShardTerms leaderTerms = new ZkShardTerms(collection, "shard1", cluster.getZkClient());+ ZkShardTerms replicaTerms = new ZkShardTerms(collection, "shard1", cluster.getZkClient());+ leaderTerms.registerTerm("leader");+ replicaTerms.registerTerm("replica");++ leaderTerms.ensureTermsIsHigher("leader", Collections.singleton("replica"));+ waitFor(false, () -> replicaTerms.canBecomeLeader("replica"));+ waitFor(true, () -> leaderTerms.skipSendingUpdatesTo("replica"));++ replicaTerms.startRecovering("replica");+ waitFor(false, () -> replicaTerms.canBecomeLeader("replica"));+ waitFor(false, () -> leaderTerms.skipSendingUpdatesTo("replica"));++ replicaTerms.doneRecovering("replica");+ waitFor(true, () -> replicaTerms.canBecomeLeader("replica"));+ waitFor(false, () -> leaderTerms.skipSendingUpdatesTo("replica"));++ leaderTerms.close();+ replicaTerms.close();+ }++ public void testSetTermEqualsToLeader() throws InterruptedException {+ String collection = "setTermEqualsToLeader";+ ZkShardTerms leaderTerms = new ZkShardTerms(collection, "shard1", cluster.getZkClient());+ ZkShardTerms replicaTerms = new ZkShardTerms(collection, "shard1", cluster.getZkClient());+ leaderTerms.registerTerm("leader");+ replicaTerms.registerTerm("replica");++ leaderTerms.ensureTermsIsHigher("leader", Collections.singleton("replica"));+ waitFor(false, () -> replicaTerms.canBecomeLeader("replica"));+ waitFor(true, () -> leaderTerms.skipSendingUpdatesTo("replica"));++ replicaTerms.setTermEqualsToLeader("replica");+ waitFor(true, () -> replicaTerms.canBecomeLeader("replica"));+ waitFor(false, () -> leaderTerms.skipSendingUpdatesTo("replica"));++ leaderTerms.close();+ replicaTerms.close();+ }++ private <T> void waitFor(T expected, Supplier<T> supplier) throws InterruptedException {+ TimeOut timeOut = new TimeOut(10, TimeUnit.SECONDS, new TimeSource.CurrentTimeSource());+ while (!timeOut.hasTimedOut()) {+ if (expected == supplier.get()) return;+ Thread.sleep(100);+ }+ assertEquals(expected, supplier.get());+ }++}diff --git a/solr/core/src/test/org/apache/solr/cloud/api/collections/CustomCollectionTest.java b/solr/core/src/test/org/apache/solr/cloud/api/collections/CustomCollectionTest.javaindex d4f3783a2ef..d556271304e 100644--- a/solr/core/src/test/org/apache/solr/cloud/api/collections/CustomCollectionTest.java+++ b/solr/core/src/test/org/apache/solr/cloud/api/collections/CustomCollectionTest.java@@ -149,7 +149,7 @@ public class CustomCollectionTest extends SolrCloudTestCase {}@Test- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // added 09-Aug-2018+ // commented out on: 17-Feb-2019 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // added 09-Aug-2018public void testRouteFieldForHashRouter()throws Exception{String collectionName = "routeFieldColl";int numShards = 4;diff --git a/solr/core/src/test/org/apache/solr/cloud/api/collections/ShardSplitTest.java b/solr/core/src/test/org/apache/solr/cloud/api/collections/ShardSplitTest.javaindex 97512a87e29..d5e5f18b255 100644--- a/solr/core/src/test/org/apache/solr/cloud/api/collections/ShardSplitTest.java+++ b/solr/core/src/test/org/apache/solr/cloud/api/collections/ShardSplitTest.java@@ -343,13 +343,13 @@ public class ShardSplitTest extends BasicDistributedZkTest {}@Test- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // added 15-Sep-2018+ // commented out on: 17-Feb-2019 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // added 15-Sep-2018public void testSplitMixedReplicaTypes() throws Exception {doSplitMixedReplicaTypes(SolrIndexSplitter.SplitMethod.REWRITE);}@Test- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 14-Oct-2018+ // commented out on: 17-Feb-2019 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 14-Oct-2018public void testSplitMixedReplicaTypesLink() throws Exception {doSplitMixedReplicaTypes(SolrIndexSplitter.SplitMethod.LINK);}diff --git a/solr/core/src/test/org/apache/solr/cloud/autoscaling/ComputePlanActionTest.java b/solr/core/src/test/org/apache/solr/cloud/autoscaling/ComputePlanActionTest.javaindex 574b25fe060..47be3dd4096 100644--- a/solr/core/src/test/org/apache/solr/cloud/autoscaling/ComputePlanActionTest.java+++ b/solr/core/src/test/org/apache/solr/cloud/autoscaling/ComputePlanActionTest.java@@ -328,7 +328,7 @@ public class ComputePlanActionTest extends SolrCloudTestCase {}@Test- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 14-Oct-2018+ // commented out on: 17-Feb-2019 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 14-Oct-2018public void testNodeAdded() throws Exception {CloudSolrClient solrClient = cluster.getSolrClient();String setTriggerCommand = "{" +@@ -624,7 +624,7 @@ public class ComputePlanActionTest extends SolrCloudTestCase {}@Test- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 14-Oct-2018+ // commented out on: 17-Feb-2019 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 14-Oct-2018public void testNodeLostTriggerWithDeleteNodePreferredOp() throws Exception {String collectionNamePrefix = "testNodeLostTriggerWithDeleteNodePreferredOp";int numCollections = 1 + random().nextInt(3), numShards = 1 + random().nextInt(3);diff --git a/solr/core/src/test/org/apache/solr/cloud/autoscaling/ScheduledTriggerIntegrationTest.java b/solr/core/src/test/org/apache/solr/cloud/autoscaling/ScheduledTriggerIntegrationTest.javaindex 50a8223f54f..4c3978f29aa 100644--- a/solr/core/src/test/org/apache/solr/cloud/autoscaling/ScheduledTriggerIntegrationTest.java+++ b/solr/core/src/test/org/apache/solr/cloud/autoscaling/ScheduledTriggerIntegrationTest.java@@ -75,7 +75,7 @@ public class ScheduledTriggerIntegrationTest extends SolrCloudTestCase {@Test// commented 15-Sep-2018 @LuceneTestCase.BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 2-Aug-2018- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 14-Oct-2018+ // commented out on: 17-Feb-2019 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 14-Oct-2018public void testScheduledTrigger() throws Exception {CloudSolrClient solrClient = cluster.getSolrClient();diff --git a/solr/core/src/test/org/apache/solr/cloud/autoscaling/TriggerIntegrationTest.java b/solr/core/src/test/org/apache/solr/cloud/autoscaling/TriggerIntegrationTest.javaindex e5fe1b061a0..2fb86c7d57e 100644--- a/solr/core/src/test/org/apache/solr/cloud/autoscaling/TriggerIntegrationTest.java+++ b/solr/core/src/test/org/apache/solr/cloud/autoscaling/TriggerIntegrationTest.java@@ -172,7 +172,7 @@ public class TriggerIntegrationTest extends SolrCloudTestCase {}@Test- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // annotated on: 24-Dec-2018+ // commented out on: 17-Feb-2019 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // annotated on: 24-Dec-2018public void testTriggerThrottling() throws Exception {// for this test we want to create two triggers so we must assert that the actions were created twiceactionInitCalled = new CountDownLatch(2);diff --git a/solr/core/src/test/org/apache/solr/cloud/autoscaling/TriggerSetPropertiesIntegrationTest.java b/solr/core/src/test/org/apache/solr/cloud/autoscaling/TriggerSetPropertiesIntegrationTest.javaindex c36d5e45978..111d1df0722 100644--- a/solr/core/src/test/org/apache/solr/cloud/autoscaling/TriggerSetPropertiesIntegrationTest.java+++ b/solr/core/src/test/org/apache/solr/cloud/autoscaling/TriggerSetPropertiesIntegrationTest.java@@ -64,7 +64,7 @@ public class TriggerSetPropertiesIntegrationTest extends SolrCloudTestCase {* Test that we can add/remove triggers to a scheduler, and change the config on the fly, and still get* expected behavior*/- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // annotated on: 24-Dec-2018+ // commented out on: 17-Feb-2019 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // annotated on: 24-Dec-2018public void testSetProperties() throws Exception {final JettySolrRunner runner = cluster.getJettySolrRunner(0);final SolrResourceLoader resourceLoader = runner.getCoreContainer().getResourceLoader();diff --git a/solr/core/src/test/org/apache/solr/cloud/autoscaling/sim/TestSimGenericDistributedQueue.java b/solr/core/src/test/org/apache/solr/cloud/autoscaling/sim/TestSimGenericDistributedQueue.javaindex 1ff6d1205c0..c4551aa7c5f 100644--- a/solr/core/src/test/org/apache/solr/cloud/autoscaling/sim/TestSimGenericDistributedQueue.java+++ b/solr/core/src/test/org/apache/solr/cloud/autoscaling/sim/TestSimGenericDistributedQueue.java@@ -31,7 +31,7 @@ public class TestSimGenericDistributedQueue extends TestSimDistributedQueue {}// commented 4-Sep-2018 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // added 09-Aug-2018- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 14-Oct-2018+ // commented out on: 17-Feb-2019 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 14-Oct-2018public void testDistributedQueue() throws Exception {super.testDistributedQueue();}diff --git a/solr/core/src/test/org/apache/solr/cloud/autoscaling/sim/TestSimLargeCluster.java b/solr/core/src/test/org/apache/solr/cloud/autoscaling/sim/TestSimLargeCluster.javaindex fed7b1430e5..624888adca6 100644--- a/solr/core/src/test/org/apache/solr/cloud/autoscaling/sim/TestSimLargeCluster.java+++ b/solr/core/src/test/org/apache/solr/cloud/autoscaling/sim/TestSimLargeCluster.java@@ -366,7 +366,7 @@ public class TestSimLargeCluster extends SimSolrCloudTestCase {@Test// commented 4-Sep-2018 @LuceneTestCase.BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 2018-06-18- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 14-Oct-2018+ // commented out on: 17-Feb-2019 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 14-Oct-2018public void testNodeLost() throws Exception {doTestNodeLost(waitForSeconds, 5000, 0);}diff --git a/solr/core/src/test/org/apache/solr/cloud/autoscaling/sim/TestSimPolicyCloud.java b/solr/core/src/test/org/apache/solr/cloud/autoscaling/sim/TestSimPolicyCloud.javaindex 9b68d36f619..0dcea03f22c 100644--- a/solr/core/src/test/org/apache/solr/cloud/autoscaling/sim/TestSimPolicyCloud.java+++ b/solr/core/src/test/org/apache/solr/cloud/autoscaling/sim/TestSimPolicyCloud.java@@ -112,7 +112,7 @@ public class TestSimPolicyCloud extends SimSolrCloudTestCase {}- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // annotated on: 24-Dec-2018+ // commented out on: 17-Feb-2019 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // annotated on: 24-Dec-2018public void testCreateCollectionAddReplica() throws Exception {SolrClient solrClient = cluster.simGetSolrClient();String nodeId = cluster.getSimClusterStateProvider().simGetRandomNode();diff --git a/solr/core/src/test/org/apache/solr/cloud/cdcr/CdcrBootstrapTest.java b/solr/core/src/test/org/apache/solr/cloud/cdcr/CdcrBootstrapTest.javaindex 87a475b5412..9be6f92eeff 100644--- a/solr/core/src/test/org/apache/solr/cloud/cdcr/CdcrBootstrapTest.java+++ b/solr/core/src/test/org/apache/solr/cloud/cdcr/CdcrBootstrapTest.java@@ -58,7 +58,7 @@ public class CdcrBootstrapTest extends SolrTestCaseJ4 {*/@Test// commented 4-Sep-2018 @LuceneTestCase.BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 2-Aug-2018- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 14-Oct-2018+ // commented out on: 17-Feb-2019 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 14-Oct-2018public void testConvertClusterToCdcrAndBootstrap() throws Exception {// start the target first so that we know its zkhostMiniSolrCloudCluster target = new MiniSolrCloudCluster(1, createTempDir("cdcr-target"), buildJettyConfig("/solr"));diff --git a/solr/core/src/test/org/apache/solr/handler/TestSystemCollAutoCreate.java b/solr/core/src/test/org/apache/solr/handler/TestSystemCollAutoCreate.javaindex ccc2e51c75a..94846d8668c 100644--- a/solr/core/src/test/org/apache/solr/handler/TestSystemCollAutoCreate.java+++ b/solr/core/src/test/org/apache/solr/handler/TestSystemCollAutoCreate.java@@ -22,7 +22,7 @@ import org.apache.solr.cloud.AbstractFullDistribZkTestBase;import org.apache.solr.common.cloud.DocCollection;public class TestSystemCollAutoCreate extends AbstractFullDistribZkTestBase {- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // annotated on: 24-Dec-2018+ // commented out on: 17-Feb-2019 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // annotated on: 24-Dec-2018public void testAutoCreate() throws Exception {TestBlobHandler.checkBlobPost(cloudJettys.get(0).jetty.getBaseUrl().toExternalForm(), cloudClient);DocCollection sysColl = cloudClient.getZkStateReader().getClusterState().getCollection(".system");diff --git a/solr/core/src/test/org/apache/solr/metrics/rrd/SolrRrdBackendFactoryTest.java b/solr/core/src/test/org/apache/solr/metrics/rrd/SolrRrdBackendFactoryTest.javaindex 936c41a1716..cdc1b619280 100644--- a/solr/core/src/test/org/apache/solr/metrics/rrd/SolrRrdBackendFactoryTest.java+++ b/solr/core/src/test/org/apache/solr/metrics/rrd/SolrRrdBackendFactoryTest.java@@ -80,7 +80,7 @@ public class SolrRrdBackendFactoryTest extends SolrTestCaseJ4 {@Test//commented 9-Aug-2018 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 28-June-2018- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 6-Sep-2018+ // commented out on: 17-Feb-2019 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 6-Sep-2018public void testBasic() throws Exception {long startTime = 1000000000;RrdDb db = new RrdDb(createDef(startTime), factory);diff --git a/solr/core/src/test/org/apache/solr/search/stats/TestDistribIDF.java b/solr/core/src/test/org/apache/solr/search/stats/TestDistribIDF.javaindex c231ec327ef..205b30b700f 100644--- a/solr/core/src/test/org/apache/solr/search/stats/TestDistribIDF.java+++ b/solr/core/src/test/org/apache/solr/search/stats/TestDistribIDF.java@@ -139,8 +139,8 @@ public class TestDistribIDF extends SolrTestCaseJ4 {}@Test-// commented 4-Sep-2018 @LuceneTestCase.BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 2-Aug-2018- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 14-Oct-2018+ // commented 4-Sep-2018 @LuceneTestCase.BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 2-Aug-2018+ // commented out on: 17-Feb-2019 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 14-Oct-2018public void testMultiCollectionQuery() throws Exception {// collection1 and collection2 are collections which have distributed idf enabled// collection1_local and collection2_local don't have distributed idf availablediff --git a/solr/core/src/test/org/apache/solr/security/BasicAuthIntegrationTest.java b/solr/core/src/test/org/apache/solr/security/BasicAuthIntegrationTest.javaindex 5233703767f..abbc05561b8 100644--- a/solr/core/src/test/org/apache/solr/security/BasicAuthIntegrationTest.java+++ b/solr/core/src/test/org/apache/solr/security/BasicAuthIntegrationTest.java@@ -92,7 +92,7 @@ public class BasicAuthIntegrationTest extends SolrCloudAuthTestCase {@Test//commented 9-Aug-2018 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 21-May-2018- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // annotated on: 24-Dec-2018+ // commented out on: 17-Feb-2019 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // annotated on: 24-Dec-2018public void testBasicAuth() throws Exception {boolean isUseV2Api = random().nextBoolean();String authcPrefix = "/admin/authentication";diff --git a/solr/core/src/test/org/apache/solr/update/TestInPlaceUpdatesDistrib.java b/solr/core/src/test/org/apache/solr/update/TestInPlaceUpdatesDistrib.javaindex e896db8ec16..c40879cf951 100644--- a/solr/core/src/test/org/apache/solr/update/TestInPlaceUpdatesDistrib.java+++ b/solr/core/src/test/org/apache/solr/update/TestInPlaceUpdatesDistrib.java@@ -125,7 +125,7 @@ public class TestInPlaceUpdatesDistrib extends AbstractFullDistribZkTestBase {@SuppressWarnings("unchecked")//28-June-2018 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 21-May-2018// commented 4-Sep-2018 @LuceneTestCase.BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 2-Aug-2018- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // annotated on: 24-Dec-2018+ // commented out on: 17-Feb-2019 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // annotated on: 24-Dec-2018public void test() throws Exception {waitForRecoveriesToFinish(true);diff --git a/solr/core/src/test/org/apache/solr/update/processor/TimeRoutedAliasUpdateProcessorTest.java b/solr/core/src/test/org/apache/solr/update/processor/TimeRoutedAliasUpdateProcessorTest.javaindex 7eeff5a87b3..485064c225b 100644--- a/solr/core/src/test/org/apache/solr/update/processor/TimeRoutedAliasUpdateProcessorTest.java+++ b/solr/core/src/test/org/apache/solr/update/processor/TimeRoutedAliasUpdateProcessorTest.java@@ -117,7 +117,7 @@ public class TimeRoutedAliasUpdateProcessorTest extends SolrCloudTestCase {@Slow@Test@LogLevel("org.apache.solr.update.processor.TimeRoutedAlias=DEBUG;org.apache.solr.cloud=DEBUG")- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 14-Oct-2018+ // commented out on: 17-Feb-2019 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 14-Oct-2018public void test() throws Exception {String configName = getSaferTestName();createConfigSet(configName);diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/LBHttpSolrClientTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/LBHttpSolrClientTest.javaindex cdc4aee05aa..e6c02f8c2a5 100644--- a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/LBHttpSolrClientTest.java+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/LBHttpSolrClientTest.java@@ -17,7 +17,6 @@package org.apache.solr.client.solrj.impl;import org.apache.http.impl.client.CloseableHttpClient;-import org.apache.lucene.util.LuceneTestCase;import org.apache.solr.client.solrj.ResponseParser;import org.apache.solr.common.params.ModifiableSolrParams;import org.junit.Test;@@ -38,7 +37,7 @@ public class LBHttpSolrClientTest {* Validate that the parser passed in is used in the <code>HttpSolrClient</code> instances created.*/@Test- @LuceneTestCase.BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // added 20-Sep-2018+ // commented out on: 17-Feb-2019 @LuceneTestCase.BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // added 20-Sep-2018public void testLBHttpSolrClientHttpClientResponseParserStringArray() throws IOException {CloseableHttpClient httpClient = HttpClientUtil.createClient(new ModifiableSolrParams());try (diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/MathExpressionTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/MathExpressionTest.javaindex d6143f374ec..6d8c9a8919b 100644--- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/MathExpressionTest.java+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/MathExpressionTest.java@@ -3644,7 +3644,7 @@ public class MathExpressionTest extends SolrCloudTestCase {@Test// 12-Jun-2018 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") //2018-03-10- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // added 20-Sep-2018+ // commented out on: 17-Feb-2019 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // added 20-Sep-2018public void testMultiVariateNormalDistribution() throws Exception {String cexpr = "let(echo=true," +" a=array(1,2,3,4,5,6,7)," +diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamDecoratorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamDecoratorTest.javaindex 560cb685ff0..7a8f5571f75 100644--- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamDecoratorTest.java+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamDecoratorTest.java@@ -2981,7 +2981,7 @@ public class StreamDecoratorTest extends SolrCloudTestCase {}@Test- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // annotated on: 24-Dec-2018+ // commented out on: 17-Feb-2019 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // annotated on: 24-Dec-2018public void testParallelCommitStream() throws Exception {CollectionAdminRequest.createCollection("parallelDestinationCollection", "conf", 2, 1).process(cluster.getSolrClient());@@ -3580,7 +3580,7 @@ public class StreamDecoratorTest extends SolrCloudTestCase {@Test- @LuceneTestCase.BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 2-Aug-2018+ // commented out on: 17-Feb-2019 @LuceneTestCase.BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 2-Aug-2018public void testParallelExecutorStream() throws Exception {CollectionAdminRequest.createCollection("workQueue1", "conf", 2, 1).processAndWait(cluster.getSolrClient(),DEFAULT_TIMEOUT);diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamingTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamingTest.javaindex 003f01b1e95..d42425e57f5 100644--- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamingTest.java+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamingTest.java@@ -1970,7 +1970,7 @@ public void testParallelRankStream() throws Exception {}@Test- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 6-Sep-2018+ // commented out on: 17-Feb-2019 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 6-Sep-2018public void testZeroParallelReducerStream() throws Exception {new UpdateRequest()@@ -2129,7 +2129,7 @@ public void testParallelRankStream() throws Exception {}@Test- @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 6-Sep-2018+ // commented out on: 17-Feb-2019 @BadApple(bugUrl="https://issues.apache.org/jira/browse/SOLR-12028") // 6-Sep-2018public void testParallelMergeStream() throws Exception {new UpdateRequest()