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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
