Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-10890

TestJsonTreeRowRecordReader.testReadRawRecordFieldOrderPreserved uses non-deterministic HashMap

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • None
    • 1.20.0, 1.19.1
    • Extensions
    • None
    • Apache Maven 3.6.0;
      openjdk version "1.8.0_342";
      OpenJDK Runtime Environment (build 1.8.0_342-8u342-b07-0ubuntu1~20.04-b07);
      OpenJDK 64-Bit Server VM (build 25.342-b07, mixed mode);

    Description

      org.apache.nifi.json.TestJsonTreeRowRecordReader.testReadRawRecordFieldOrderPreserved

      This is a flaky test, it can pass mvn test while but when run using the tool NonDex, it fails. NonDex is a tool that will introduce non-determinism in certain java collections.

      The test shows below:

      [ERROR]   TestJsonTreeRowRecordReader.testReadRawRecordFieldOrderPreserved:433 expected: <MapRecord[{id=1, name=John Doe, address=123 My Street, city=My City, state=MS, zipCode=11111, country=USA, account=MapRecord[{balance=4750.89, id=42}]}]> but was: <MapRecord[{id=1, name=John Doe, address=123 My Street, city=My City, state=MS, zipCode=11111, country=USA, account=MapRecord[{id=42, balance=4750.89}]}]>

      Steps to reproduce the failure:

      1. Run the following command in nifi:
      2. First, build the module:
      mvn install -pl nifi-nar-bundles/nifi-standard-services/nifi-record-serialization-services-bundle/nifi-record-serialization-services -DskipTests -Drat.skip -am
      1. Then run the test using NonDex
      mvn edu.illinois:nondex-maven-plugin:1.1.2:nondex -pl nifi-nar-bundles/nifi-standard-services/nifi-record-serialization-services-bundle/nifi-record-serialization-services -Dtest=org.apache.nifi.json.TestJsonTreeRowRecordReader#testReadRawRecordFieldOrderPreserved 

      The result will be saved under the module folder in .nondex

      Attachments

        Issue Links

          Activity

            People

              sopan98 Sopan Phaltankar
              sopan98 Sopan Phaltankar
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h