You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by alopresto <gi...@git.apache.org> on 2018/08/29 02:54:35 UTC

[GitHub] nifi pull request #2972: NIFI-5558 Fixed unit test to avoid contamination fr...

GitHub user alopresto opened a pull request:

    https://github.com/apache/nifi/pull/2972

    NIFI-5558 Fixed unit test to avoid contamination from System property…

    … "nifi.properties.file.path" when creating test NiFiProperties instance.
    
    Thank you for submitting a contribution to Apache NiFi.
    
    In order to streamline the review of the contribution we ask you
    to ensure the following steps have been taken:
    
    ### For all changes:
    - [x] Is there a JIRA ticket associated with this PR? Is it referenced 
         in the commit message?
    
    - [x] Does your PR title start with NIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
    
    - [x] Has your PR been rebased against the latest commit within the target branch (typically master)?
    
    - [x] Is your initial contribution a single, squashed commit?
    
    ### For code changes:
    - [x] Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder?
    - [x] Have you written or updated unit tests to verify your changes?
    - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? 
    - [ ] If applicable, have you updated the LICENSE file, including the main LICENSE file under nifi-assembly?
    - [ ] If applicable, have you updated the NOTICE file, including the main NOTICE file found under nifi-assembly?
    - [ ] If adding new Properties, have you added .displayName in addition to .name (programmatic access) for each of the new properties?
    
    ### For documentation related changes:
    - [ ] Have you ensured that format looks appropriate for the output in which it is rendered?
    
    ### Note:
    Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/alopresto/nifi NIFI-5558

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/nifi/pull/2972.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2972
    
----
commit 9c9db43bd157d84ff58e9003f646c4ff38147f56
Author: Andy LoPresto <al...@...>
Date:   2018-08-29T02:53:45Z

    NIFI-5558 Fixed unit test to avoid contamination from System property "nifi.properties.file.path" when creating test NiFiProperties instance.

----


---

[GitHub] nifi issue #2972: NIFI-5558 Fixed unit test to avoid contamination from Syst...

Posted by thenatog <gi...@git.apache.org>.
Github user thenatog commented on the issue:

    https://github.com/apache/nifi/pull/2972
  
    ./nifi-framework-cluster
    mvn clean test -Dtest=PopularVoteFlowElectionFactoryBeanTest
    
    [INFO] Results:
    [INFO] 
    [INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
    
    ./nifi-framework-cluster
mvn clean test
    
    [INFO] Results:
    [INFO] 
    [INFO] Tests run: 94, Failures: 0, Errors: 0, Skipped: 0
    
    ./nifi
    mvn clean install -T4 -Pinclude-grpc
    
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 10:49 min (Wall Clock)



---

[GitHub] nifi issue #2972: NIFI-5558 Fixed unit test to avoid contamination from Syst...

Posted by alopresto <gi...@git.apache.org>.
Github user alopresto commented on the issue:

    https://github.com/apache/nifi/pull/2972
  
    The issue that was encountered by some users was that the previous mechanism for creating a test `NiFiProperties` instance was `NiFiProperties.createBasicNiFiProperties(String filePath, Map<String, String> additionalProperties)`. When provided a `null` file path, the code tried to use `System.getProperty("nifi.properties.file.path")` to locate the `nifi.properties` file. On my machine, the test code which was evaluating the _empty key_ scenario returned an empty `NiFiProperties` instance with only the overridden properties populated, but on other machines, this code was loading the properties from `src/test/resources/conf/nifi.properties` where the `nifi.sensitive.props.key=key`. Because of this, the two passwords were not equal, and the keys derived from them were different. When you attempt to decrypt data with the wrong key, a `pad block corrupted` error is common. 
    
    The tests still work for me in the following scenarios, so I need a user who encountered the error to validate that this fixes the issue on their system. 
    
    * via IntelliJ Run/Debug
    * via IntelliJ Maven execution
    * via command-line Maven execution
      * specific test using `mvn clean test -Dtest=PopularVoteFlowElectionFactoryBeanTest`
      * module using `.../nifi-framework-cluster $ mvn clean test`
      * full build from root
    * with JCE Unlimited Strength Jurisdiction Policies
    * without JCE USJP


---

[GitHub] nifi issue #2972: NIFI-5558 Fixed unit test to avoid contamination from Syst...

Posted by alopresto <gi...@git.apache.org>.
Github user alopresto commented on the issue:

    https://github.com/apache/nifi/pull/2972
  
    Merging. 


---

[GitHub] nifi pull request #2972: NIFI-5558 Fixed unit test to avoid contamination fr...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/nifi/pull/2972


---