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/10/24 03:31:40 UTC

[GitHub] [nifi] BoyuLi4 opened a new pull request, #6569: NIFI-XX Fixed Possible Array Ordering Permutations Problem in Tests

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

   <!-- 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-XXX](https://issues.apache.org/jira/browse/NIFI-10630)
   Following the problem of flakiness that occurred in the project
   `nifi-nar-bundles/nifi-asn1-bundle/nifi-asn1-services`
   test file
   `org.apache.nifi.jasn1.TestJASN1RecordReaderWithComplexTypes`
   with below three tests
   ```
   testBasicTypes
   testRecursive
   testInheritance
   ```
   All three above test use the same file, `JASN1ReadRecordTester` as tester.
   The test flakiness is due to comparisons between two ArrayList outputs from Class
   `SimpleRecordSchema` which use ArrayList to store one of the parameter `List<RecordField>`
   
   However, ArrayList does not guarantee entry orders, its object is an unordered set of name/value pairs, and internal permutations may occur in the output as a String.
   
   ## Brief changelog
   
   Since the class `SimpleRecordSchema` is a shared Library of the entire NIFI project, so I don't want to touch it.
   And the List is stored with Object `RecordField` so a typical sort is not working. And I use `Collections `and `Comparator` to reorder the whole list before comparing them.
   Thus the added lines seem excessive.
   
   ## Verifying this change
   
   This test avoids different orders of ArrayList strings that cause flaky errors.
   Since I didn't touch any Source code, it should be no impact on the project.
   And it passed the local test that the guidelines mentioned.
   
   # 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
   
   - [X] Build completed using `mvn clean install -P contrib-check`
     - [ ] JDK 8
     - [X] JDK 11
     - [ ] JDK 17
   
   ### Licensing
   
   - [x] 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)
   - [x] New dependencies are documented in applicable `LICENSE` and `NOTICE` files
   
   ### Documentation
   
   - [x] 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] BoyuLi4 commented on pull request #6569: NIFI-10692 Fixed Possible Array Ordering Permutations Problem in Tests

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

   HI, 
   could you please re-run the checks? 
   I have seen that all small parts of the failed checks were passed actually, but in the end it ran out of time...


-- 
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 #6569: NIFI-10692 Fixed Possible Array Ordering Permutations Problem in Tests

Posted by "exceptionfactory (via GitHub)" <gi...@apache.org>.
exceptionfactory closed pull request #6569: NIFI-10692 Fixed Possible Array Ordering Permutations Problem in Tests
URL: https://github.com/apache/nifi/pull/6569


-- 
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] joewitt commented on pull request #6569: NIFI-XX Fixed Possible Array Ordering Permutations Problem in Tests

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

   I've approved this to run but looking at the code it strikes me that we should be ensuring the equals check for RecordSchema objects works correctly rather than having to tweak it in this test.  What is missing/incorrect in the current equals check of RecordSchema?


-- 
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] BoyuLi4 commented on pull request #6569: NIFI-10692 Fixed Possible Array Ordering Permutations Problem in Tests

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

   Sorry, this is just a draft without the ISSUE part. . I opened it by mistake yesterday.
   But, I have updated the ISSUE section with the tool I use and the steps just now. Hope this will helps.
   
   


-- 
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 #6569: NIFI-10692 Fixed Possible Array Ordering Permutations Problem in Tests

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

   @BoyuLi4 Thanks for the contribution, but the current changes do not address the root cause of the concern. Making this type of change in a test method does not address the source of potential non-deterministic behavior, and leaves the possibility of it easily coming up in other places. I am closing this pull request for now, but feel free to open a new pull request after evaluating the root cause and potential solutions.


-- 
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] ottobackwards commented on pull request #6569: NIFI-XX Fixed Possible Array Ordering Permutations Problem in Tests

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

   They are using an analysis tool that flags these kinds of things even if you don't see issues I think


-- 
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