You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Xinyu Wu (Jira)" <ji...@apache.org> on 2022/03/07 14:54:00 UTC

[jira] [Created] (NIFI-9768) Indeterminate Map ordering in TestAttributesToCSV

Xinyu Wu created NIFI-9768:
------------------------------

             Summary: Indeterminate Map ordering in TestAttributesToCSV
                 Key: NIFI-9768
                 URL: https://issues.apache.org/jira/browse/NIFI-9768
             Project: Apache NiFi
          Issue Type: Bug
            Reporter: Xinyu Wu


The test `org.apache.nifi.processors.standard.TestAttributesToCSV#testSchemaToAttribute` can fail based on the order of iteration in `HashMap`. I found the issue using [NonDex](https://github.com/TestingResearchIllinois/NonDex):
```
mvn install -DskipTests -pl nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors -am
mvn -pl nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors edu.illinois:nondex-maven-plugin:1.1.2:nondex -Dtest=org.apache.nifi.processors.standard.TestAttributesToCSV#testSchemaToContent
```
The problem can be solved by changing several `HashMap` to `LinkedHashMap`, or changing the assertion to endure the nondeterministic order. 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)