You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Knagwei Zhu (Jira)" <ji...@apache.org> on 2025/09/19 00:31:00 UTC
[jira] [Created] (NIFI-14994) TestQueryRecord Test Failures on NonDex
Knagwei Zhu created NIFI-14994:
----------------------------------
Summary: TestQueryRecord Test Failures on NonDex
Key: NIFI-14994
URL: https://issues.apache.org/jira/browse/NIFI-14994
Project: Apache NiFi
Issue Type: Bug
Components: Extensions
Environment: Apache Maven 3.9.11 (3e54c93a704957b63ee3494413a2b544fd3d825b)
Maven home: /home/anicaazhu/.sdkman/candidates/maven/current
Java version: 21.0.7, vendor: Oracle Corporation, runtime: /home/anicaazhu/.sdkman/candidates/java/21.0.7-oracle
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "6.16.7-arch1-1", arch: "amd64", family: "unix"
Reporter: Knagwei Zhu
Fix For: 2.6.0
The test *org.apache.nifi.processors.standard.TestQueryRecord.*
{*}testAggregateFunction({*}nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestQueryRecord.java{*}){*} passed using normal maven-test, but showed Non-deterministic behavior under NonDex([https://github.com/TestingResearchIllinois/NonDex)] and thus failed. Some of the error messages are:
```
Build Failure observed:
expected:
"name","points" "Tom","100" "Jerry","2"
but was:
"name","points" "Jerry","2" "Tom","100"
```
Steps to reproduce:
```
mvn clean install -DskipTests -T1C
```
```
mvn -pl nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors \
edu.illinois:nondex-maven-plugin:2.2.1:nondex \
-Dtest=org.apache.nifi.processors.standard.TestQueryRecord#testAggregateFunction
````
Root cause:
* The test asserted a fixed row order on the result of a SQL GROUP BY query.
* GROUP BY does not guarantee ordering; Calcite (used in QueryRecord) may return rows in different orders depending on internal HashMap iteration.
* This led to nondeterministic test outcomes.
Fix:
* Add ORDER BY clause ({{{}ORDER BY points DESC{}}}) in {{TestQueryRecord}} class's {{testAggregateFunction}} method's test SQL so row order is deterministic.
* This stabilizes assertions {*}without altering QueryRecord processor logic, and the purpose of this testing aggregation function{*}.
Confirm Fixed:
Re-run
```
mvn -pl nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors \
edu.illinois:nondex-maven-plugin:2.2.1:nondex \
-Dtest=org.apache.nifi.processors.standard.TestQueryRecord#testAggregateFunction
```
And the result is {{Tests run: 1, Failures: 0, Errors: 0, Skipped: 0}}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)