From 7eeec006b38e8783b82b5b49d857ec7f91092275 Mon Sep 17 00:00:00 2001 From: Steve Loughran Date: Mon, 10 Nov 2025 20:30:37 +0000 Subject: [PATCH] HADOOP-19719. Wildfly Followup: TestDelegatingSSLSocketFactory Downgrade to a skipped tests if the OS doesn't have GLIBC_2.34. The branch-3.4 version of the patch doesn't delete testJSEENoGCMJava8() and uses classic junit assumeTrue() calls. --- .../ssl/TestDelegatingSSLSocketFactory.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/ssl/TestDelegatingSSLSocketFactory.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/ssl/TestDelegatingSSLSocketFactory.java index f19f65b18cfe6..084f9790ca1b7 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/ssl/TestDelegatingSSLSocketFactory.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/ssl/TestDelegatingSSLSocketFactory.java @@ -25,6 +25,7 @@ import org.apache.hadoop.util.NativeCodeLoader; +import static org.apache.hadoop.test.GenericTestUtils.assertExceptionContains; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assume.assumeTrue; @@ -34,15 +35,21 @@ public class TestDelegatingSSLSocketFactory { @Test - public void testOpenSSL() throws IOException { + public void testOpenSSL() { assumeTrue("Unable to load native libraries", NativeCodeLoader.isNativeCodeLoaded()); assumeTrue("Build was not compiled with support for OpenSSL", NativeCodeLoader.buildSupportsOpenssl()); - DelegatingSSLSocketFactory.initializeDefaultFactory( - DelegatingSSLSocketFactory.SSLChannelMode.OpenSSL); - assertThat(DelegatingSSLSocketFactory.getDefaultFactory() - .getProviderName()).contains("openssl"); + try { + DelegatingSSLSocketFactory.initializeDefaultFactory( + DelegatingSSLSocketFactory.SSLChannelMode.OpenSSL); + assertThat(DelegatingSSLSocketFactory.getDefaultFactory() + .getProviderName()).contains("openssl"); + } catch (IOException e) { + // if this is caused by a wildfly version error, downgrade to an assume + assertExceptionContains("GLIBC_2.34", e); + assumeTrue("wildfly library not compatible with this OS version", false); + } } @Test