This is an automated email from the ASF dual-hosted git repository.

stevel pushed a commit to branch branch-3.4
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/branch-3.4 by this push:
     new 6ecc6933300 HADOOP-19719. Wildfly Followup: 
TestDelegatingSSLSocketFactory (#8075)  (#8071)
6ecc6933300 is described below

commit 6ecc693330091c6b90f08fb69fe7f07228fa5107
Author: Steve Loughran <[email protected]>
AuthorDate: Wed Nov 19 10:53:28 2025 +0000

    HADOOP-19719. Wildfly Followup: TestDelegatingSSLSocketFactory (#8075)  
(#8071)
    
    
    Downgrade to a skipped test if the attempting to create an openssl factory
    raises a wrapped NoSuchAlgorithmException; this is to avoid failures on test
    runs on RHEL8 VMs.
    
    Note: this branch-3.4 version preserves the test testJSEENoGCMJava8().
    
    Contributed by Steve Loughran
---
 .../ssl/TestDelegatingSSLSocketFactory.java         | 21 ++++++++++++++++-----
 1 file changed, 16 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 f19f65b18cf..cc73bba0976 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
@@ -19,8 +19,10 @@
 package org.apache.hadoop.security.ssl;
 
 import java.io.IOException;
+import java.security.NoSuchAlgorithmException;
 import java.util.Arrays;
 
+import org.assertj.core.api.Assertions;
 import org.junit.Test;
 
 import org.apache.hadoop.util.NativeCodeLoader;
@@ -34,15 +36,24 @@
 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
+      final Throwable cause = e.getCause();
+      Assertions.assertThat(cause)
+              .describedAs("Cause of %s: %s", e, cause)
+              .isInstanceOf(NoSuchAlgorithmException.class);
+      assumeTrue("wildfly library not compatible with this OS version", false);
+    }
   }
 
   @Test


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to