remove thread leak filter, should have been removed in #9843

This commit is contained in:
Ryan Ernst 2015-02-26 23:23:39 -08:00
parent 3b7928d568
commit e221dc20a4
1 changed files with 0 additions and 55 deletions

View File

@ -1,55 +0,0 @@
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch 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.elasticsearch.test;
import com.carrotsearch.randomizedtesting.ThreadFilter;
import org.elasticsearch.common.network.MulticastChannel;
import org.elasticsearch.tribe.TribeTests;
import java.util.regex.Pattern;
/**
* Simple thread filter for randomized runner
* This filter rejectes all threads that are known to leak across tests / suites
* It will cause threads leaking from threadpools / executors in unittests
* to fail the test.
*/
public final class ElasticsearchThreadFilter implements ThreadFilter {
private final Pattern nodePrefix = Pattern.compile("\\[(" +
"(" + Pattern.quote(InternalTestCluster.TRANSPORT_CLIENT_PREFIX) + ")?(" +
Pattern.quote(ElasticsearchIntegrationTest.SUITE_CLUSTER_NODE_PREFIX) + "|" +
Pattern.quote(ElasticsearchIntegrationTest.TEST_CLUSTER_NODE_PREFIX) + "|" +
Pattern.quote(ExternalTestCluster.EXTERNAL_CLUSTER_PREFIX) + "|" +
Pattern.quote(TribeTests.SECOND_CLUSTER_NODE_PREFIX) + ")"
+ ")\\d+\\]");
@Override
public boolean reject(Thread t) {
String threadName = t.getName();
if (threadName.contains("[" + MulticastChannel.SHARED_CHANNEL_NAME + "]")
|| threadName.contains("[" + ElasticsearchSingleNodeTest.nodeName() + "]")
|| threadName.contains("Keep-Alive-Timer")) {
return true;
}
return nodePrefix.matcher(t.getName()).find();
}
}