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/08/29 22:06:32 UTC

[GitHub] [nifi] CornDavid5 opened a new pull request, #6347: fix flaky test case

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

   <!-- 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
   The test `org.apache.nifi.remote.client.http.TestHttpClient#testSendSuccessWithProxy` is flaky. The reason for that is due to the non-deterministic behavior of `java.util.HashMap`, which makes no guarantees as to the order of the map.
   
   The fix is mainly to preserve the ordering when interact with the map object.
    
   # Brief changelog
   Change the usage of `java.util.HashMap` to `java.util.LinkedHashMap`. 
   
   LinkedHashMap in Java 8 is implemented using double-linked list, the list will define the iteration ordering, therefore, when interact with the map object, the order will be the same for different iteration of the test. 
   
   Due to this change, I also update the expected value used in the test.
   
   # Verification
   `mvn -pl nifi-commons/nifi-site-to-site-client edu.illinois:nondex-maven-plugin:1.1.2:nondex -Dtest=org.apache.nifi.remote.client.http.TestHttpClient#testSendSuccessWithProxy -DnondexRuns=10`
   
   ### Build
   
   - [ ] Build completed using `mvn install -pl nifi-commons/nifi-site-to-site-client -am -DskipTests`
     - [ ] JDK 8
     - [ ] JDK 11
     - [ ] JDK 17
   


-- 
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 #6347: fix flaky test case

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

   Thanks for the contribution @CornDavid5. The test itself is not unstable, but changing HashMap to LinkedHashMap is a helpful improvement.
   
   Please review the Pull Request template for submitting changes. In particular, each pull request needs an associated [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI) issue for tracking.


-- 
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] CornDavid5 closed pull request #6347: fix flaky test case

Posted by GitBox <gi...@apache.org>.
CornDavid5 closed pull request #6347: fix flaky test case
URL: https://github.com/apache/nifi/pull/6347


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