[ 
https://issues.apache.org/jira/browse/NIFI-10989?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17648320#comment-17648320
 ] 

ASF subversion and git services commented on NIFI-10989:
--------------------------------------------------------

Commit a8974253ce3b3441756bac9f7584b651c1ac01ac in nifi's branch 
refs/heads/main from David Handermann
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=a8974253ce ]

NIFI-10989 Removed SHA-1 and MD5 from TestHashContent

- Removed methods to avoid intermittent failures due to lack of Bouncy Castle 
Security Provider registration

Signed-off-by: Matthew Burgess <mattyb...@apache.org>

This closes #6790


> Intermittent Failures in TestHashContent
> ----------------------------------------
>
>                 Key: NIFI-10989
>                 URL: https://issues.apache.org/jira/browse/NIFI-10989
>             Project: Apache NiFi
>          Issue Type: Bug
>            Reporter: David Handermann
>            Assignee: David Handermann
>            Priority: Blocker
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> The {{TestHashContent.testSHA1}} method fails intermittently on GitHub 
> automated builds, and also fails consistently when running as an individual 
> test class with the following error:
> {noformat}
> Error:  Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.063 
> s <<< FAILURE! - in org.apache.nifi.processors.standard.TestHashContent
> Error:  org.apache.nifi.processors.standard.TestHashContent.testSHA1  Time 
> elapsed: 0.016 s  <<< FAILURE!
> org.opentest4j.AssertionFailedError:
> Processor has 1 validation failures:
> 'Hash Algorithm' validated against 'SHA-1' is invalid because Given value not 
> found in allowed set 'SHA3-512, SHA-384, SHA, SHA3-384, SHA-224, SHA-512/256, 
> SHA-256, MD2, SHA-512/224, SHA3-256, SHA-512, MD5, SHA3-224'
> {noformat}
> The problem is the result of {{Security.getAlgorithms("MessageDigest")}} 
> returning different results in different scenarios. The standard JDK returns 
> {{SHA}} but the Bouncy Castle Security Provider returns {{SHA-1}}. In some 
> Maven builds, other classes invoke {{Security.addProvider(new 
> BouncyCastleProvider())}} which changes the registered security providers for 
> the entire Java Runtime. This allows the current test method to run 
> successfully. In scenarios where the Bouncy Castle Provider is not 
> registered, the test fails.
> The {{HashContent}} Processor is deprecated in favor of 
> {{CryptographicHashContent}} and will be removed in subsequent major 
> releases. Although one solution would involve registering the Bouncy Castle 
> Provider, removing the test method avoids intermittent failures and 
> simplifies future maintenance with impending removal the Processor.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to