You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2022/12/06 06:05:22 UTC

[GitHub] [nifi] TheGreatRandall opened a new pull request, #6761: Fix TestScriptedPartitionRecord.testWhenMultiplePartitions

TheGreatRandall opened a new pull request, #6761:
URL: https://github.com/apache/nifi/pull/6761

   <!-- Licensed to the Apache Software Foundation (ASF) under one or more -->
   <!-- contributor license agreements.  See the NOTICE file distributed with -->
   <!-- this work for additional information regarding copyright ownership. -->
   <!-- The ASF licenses this file to You under the Apache License, Version 2.0 -->
   <!-- (the "License"); you may not use this file except in compliance with -->
   <!-- the License.  You may obtain a copy of the License at -->
   <!--     http://www.apache.org/licenses/LICENSE-2.0 -->
   <!-- Unless required by applicable law or agreed to in writing, software -->
   <!-- distributed under the License is distributed on an "AS IS" BASIS, -->
   <!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -->
   <!-- See the License for the specific language governing permissions and -->
   <!-- limitations under the License. -->
   
   # Summary
   
   [NIFI-10952](https://issues.apache.org/jira/browse/NIFI-10952)
   Following the problem in the issue NIFI-10952. The issue happens on "thenPartitionContains" function. And I dive in to "thenPartitionContains" function and MockFlowFile interface. And when partition = partition2, I print out the FlowFile attributes by following code:
   ```
   System.out.println(flowFile.getAttributes());
   ``` 
   And I get both flowFiles attributes, which looks like this:
   ```
   FlowFile[1,39513435360922.mockFlowFile,33B]
   {record.count=2, filename=39513435360922.mockFlowFile, fragment.index=0, uuid=4de4472c-fce3-4801-bb00-fd81a2c8e95d, path=target, mime.type=text/plain, partition=partition1, fragment.count=2}
   FlowFile[2,39513435360922.mockFlowFile,21B]
   {mime.type=text/plain, fragment.count=2, record.count=1, path=target, filename=39513435360922.mockFlowFile, partition=partition2, uuid=55e22965-9321-4963-8b39-a9c1160c4da6, fragment.index=1}
   ```
   As we can see here, when the partition = partition2, the fragment.index is always 1. But what the author set the index parameter is 0. Which is never gonna happen. So I make changes on the place where the "thenPartitionContains" get called :
   
   ```
   thenPartitionContains(PARTITION_2, 1, 2, PARTITION_2_RECORD_1);
   thenPartitionContains(PARTITION_1, 0, 2, PARTITION_1_RECORD_1, PARTITION_1_RECORD_2);
   ```
   By changing this, the if statement can correctly work and the bug has been fixed. It is not flaky anymore and can pass the NonDex's check.
   
   # Tracking
   
   Please complete the following tracking steps prior to pull request creation.
   
   ### Issue Tracking
   
   - [X] [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI) issue created
   
   ### Pull Request Tracking
   
   - [X] Pull Request title starts with Apache NiFi Jira issue number, such as `NIFI-00000`
   - [X] Pull Request commit message starts with Apache NiFi Jira issue number, as such `NIFI-00000`
   
   ### Pull Request Formatting
   
   - [X] Pull Request based on current revision of the `main` branch
   - [X] Pull Request refers to a feature branch with one commit containing changes
   
   # Verification
   
   Please indicate the verification steps performed prior to pull request creation.
   
   ### Build
   
   - [ ] Build completed using `mvn clean install -P contrib-check`
     - [X] JDK 8
     - [ ] JDK 11
     - [ ] JDK 17
   
   ### Licensing
   
   - [ ] New dependencies are compatible with the [Apache License 2.0](https://apache.org/licenses/LICENSE-2.0) according to the [License Policy](https://www.apache.org/legal/resolved.html)
   - [ ] New dependencies are documented in applicable `LICENSE` and `NOTICE` files
   
   ### Documentation
   
   - [ ] Documentation formatting appears as expected in rendered files
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nifi] exceptionfactory commented on pull request #6761: NIFI-10952 - Fix TestScriptedPartitionRecord.testWhenMultiplePartitions

Posted by "exceptionfactory (via GitHub)" <gi...@apache.org>.
exceptionfactory commented on PR #6761:
URL: https://github.com/apache/nifi/pull/6761#issuecomment-1405386167

   Closing this pull request for now since the proposed changes break expectations in existing the unit test:
   
   ```
   TestScriptedPartitionRecord.testWhenMultiplePartitions:94->thenPartitionContains:160 expected:<[1]> but was:<[0]>
   ```
   Feel free to reopen the PR or submit a new one after confirming a successful run with `mvn clean install -am -pl :nifi-scripting-processors`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nifi] exceptionfactory commented on pull request #6761: NIFI-10952 - Fix TestScriptedPartitionRecord.testWhenMultiplePartitions

Posted by GitBox <gi...@apache.org>.
exceptionfactory commented on PR #6761:
URL: https://github.com/apache/nifi/pull/6761#issuecomment-1339639014

   Running a full build with `mvn clean install` should run the tests and show the problems.
   
   For this particular module, running `mvn clean install -am -pl :nifi-scripting-processors` should run the impacted code and show the test failures.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nifi] TheGreatRandall commented on pull request #6761: NIFI-10952 - Fix TestScriptedPartitionRecord.testWhenMultiplePartitions

Posted by GitBox <gi...@apache.org>.
TheGreatRandall commented on PR #6761:
URL: https://github.com/apache/nifi/pull/6761#issuecomment-1339504069

   > @TheGreatRandall Please run a local build and test to verify changes prior to submitting a pull request. As shown in the automated checks, this change breaks the unit test on all platforms.
   
   Hi there,
   I got Build Successful on my end before I make a PR. And the result shows it failed one test in overall 92 tests. Is there any possible I can see the test which failed? Thank you!
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nifi] exceptionfactory closed pull request #6761: NIFI-10952 - Fix TestScriptedPartitionRecord.testWhenMultiplePartitions

Posted by "exceptionfactory (via GitHub)" <gi...@apache.org>.
exceptionfactory closed pull request #6761: NIFI-10952 - Fix TestScriptedPartitionRecord.testWhenMultiplePartitions
URL: https://github.com/apache/nifi/pull/6761


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org