File tree Expand file tree Collapse file tree 8 files changed +64
-0
lines changed
libs/ssl-config/src/test/java/org/opensearch/common/ssl
modules/reindex/src/test/java/org/opensearch/index/reindex Expand file tree Collapse file tree 8 files changed +64
-0
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ * SPDX-License-Identifier: Apache-2.0
3+ *
4+ * The OpenSearch Contributors require contributions made to
5+ * this file be licensed under the Apache-2.0 license or a
6+ * compatible open source license.
7+ */
8+
9+ package org .opensearch .common .ssl ;
10+
11+ import com .carrotsearch .randomizedtesting .ThreadFilter ;
12+
13+ /**
14+ * ThreadFilter to exclude ThreadLeak checks for BC’s global background threads
15+ */
16+ public class BouncyCastleThreadFilter implements ThreadFilter {
17+ @ Override
18+ public boolean reject (Thread t ) {
19+ String n = t .getName ();
20+ // Ignore BC’s global background threads
21+ return "BC Disposal Daemon" .equals (n ) || "BC Cleanup Executor" .equals (n );
22+ }
23+ }
Original file line number Diff line number Diff line change 3232
3333package org .opensearch .common .ssl ;
3434
35+ import com .carrotsearch .randomizedtesting .annotations .ThreadLeakFilters ;
36+
3537import org .opensearch .test .OpenSearchTestCase ;
3638import org .hamcrest .Matchers ;
3739
5557import static org .hamcrest .Matchers .iterableWithSize ;
5658import static org .hamcrest .Matchers .notNullValue ;
5759
60+ @ ThreadLeakFilters (filters = BouncyCastleThreadFilter .class )
5861public class PemKeyConfigTests extends OpenSearchTestCase {
5962 private static final int IP_NAME = 7 ;
6063 private static final int DNS_NAME = 2 ;
Original file line number Diff line number Diff line change 3232
3333package org .opensearch .common .ssl ;
3434
35+ import com .carrotsearch .randomizedtesting .annotations .ThreadLeakFilters ;
36+
3537import org .opensearch .test .OpenSearchTestCase ;
3638import org .hamcrest .Matchers ;
3739
5153import java .util .stream .Collectors ;
5254import java .util .stream .Stream ;
5355
56+ @ ThreadLeakFilters (filters = BouncyCastleThreadFilter .class )
5457public class PemTrustConfigTests extends OpenSearchTestCase {
5558
5659 public void testBuildTrustConfigFromSinglePemFile () throws Exception {
Original file line number Diff line number Diff line change 3232
3333package org .opensearch .common .ssl ;
3434
35+ import com .carrotsearch .randomizedtesting .annotations .ThreadLeakFilters ;
36+
3537import org .bouncycastle .asn1 .ASN1ObjectIdentifier ;
3638import org .bouncycastle .asn1 .pkcs .PrivateKeyInfo ;
3739import org .opensearch .test .OpenSearchTestCase ;
5658import static org .hamcrest .Matchers .equalTo ;
5759import static org .hamcrest .core .StringContains .containsString ;
5860
61+ @ ThreadLeakFilters (filters = BouncyCastleThreadFilter .class )
5962public class PemUtilsTests extends OpenSearchTestCase {
6063
6164 private static final Supplier <char []> EMPTY_PASSWORD = () -> new char [0 ];
Original file line number Diff line number Diff line change 3232
3333package org .opensearch .common .ssl ;
3434
35+ import com .carrotsearch .randomizedtesting .annotations .ThreadLeakFilters ;
36+
3537import org .opensearch .common .settings .MockSecureSettings ;
3638import org .opensearch .common .settings .Settings ;
3739import org .opensearch .core .common .settings .SecureString ;
5153import static org .hamcrest .Matchers .is ;
5254import static org .hamcrest .Matchers .notNullValue ;
5355
56+ @ ThreadLeakFilters (filters = BouncyCastleThreadFilter .class )
5457public class SslConfigurationLoaderTests extends OpenSearchTestCase {
5558
5659 private final String STRONG_PRIVATE_SECRET = "6!6428DQXwPpi7@$ggeg/=" ;
Original file line number Diff line number Diff line change 3232
3333package org .opensearch .common .ssl ;
3434
35+ import com .carrotsearch .randomizedtesting .annotations .ThreadLeakFilters ;
36+
3537import org .opensearch .common .Nullable ;
3638import org .opensearch .test .OpenSearchTestCase ;
3739import org .hamcrest .Matchers ;
5961
6062import org .mockito .Mockito ;
6163
64+ @ ThreadLeakFilters (filters = BouncyCastleThreadFilter .class )
6265public class SslDiagnosticsTests extends OpenSearchTestCase {
6366
6467 // Some constants for use in mock certificates
Original file line number Diff line number Diff line change 1+ /*
2+ * SPDX-License-Identifier: Apache-2.0
3+ *
4+ * The OpenSearch Contributors require contributions made to
5+ * this file be licensed under the Apache-2.0 license or a
6+ * compatible open source license.
7+ */
8+
9+ package org .opensearch .index .reindex ;
10+
11+ import com .carrotsearch .randomizedtesting .ThreadFilter ;
12+
13+ /**
14+ * ThreadFilter to exclude ThreadLeak checks for BC’s global background threads
15+ */
16+ public class BouncyCastleThreadFilter implements ThreadFilter {
17+ @ Override
18+ public boolean reject (Thread t ) {
19+ String n = t .getName ();
20+ // Ignore BC’s global background threads
21+ return "BC Disposal Daemon" .equals (n ) || "BC Cleanup Executor" .equals (n );
22+ }
23+ }
Original file line number Diff line number Diff line change 3232
3333package org .opensearch .index .reindex ;
3434
35+ import com .carrotsearch .randomizedtesting .annotations .ThreadLeakFilters ;
36+
3537import com .sun .net .httpserver .HttpsConfigurator ;
3638import com .sun .net .httpserver .HttpsExchange ;
3739import com .sun .net .httpserver .HttpsParameters ;
8284 * right SSL keys + trust settings.
8385 */
8486@ SuppressForbidden (reason = "use http server" )
87+ @ ThreadLeakFilters (filters = BouncyCastleThreadFilter .class )
8588public class ReindexRestClientSslTests extends OpenSearchTestCase {
8689
8790 private static final String STRONG_PRIVATE_SECRET = "6!6428DQXwPpi7@$ggeg/=" ;
You can’t perform that action at this time.
0 commit comments