You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Armin Rahbar (Jira)" <ji...@apache.org> on 2023/03/29 21:45:00 UTC
[jira] [Created] (NIFI-11362) Fixed Flaky Test in TestValidateRecord.java
Armin Rahbar created NIFI-11362:
-----------------------------------
Summary: Fixed Flaky Test in TestValidateRecord.java
Key: NIFI-11362
URL: https://issues.apache.org/jira/browse/NIFI-11362
Project: Apache NiFi
Issue Type: Bug
Affects Versions: nifi-nar-maven-plugin-1.5.0, 1.19.1, 1.20.0, 1.19.0, 1.18.0, nifi-nar-maven-plugin-1.4.0, 1.16.3, 1.16.2, 1.16.1, 1.17.0, 1.15.3, 1.15.2, 1.15.1, nifi-nar-maven-plugin-1.3.4, 1.16.0, 1.15.0, 1.13.2, 1.13.1, 1.14.0, 1.12.1, 1.13.0, 1.11.4, 1.11.3, 1.11.2, 1.11.1, 1.12.0, 1.11.0, nifi-nar-maven-plugin-1.3.2, 1.10.0, nifi-nar-maven-plugin-1.3.3
Environment: Java 11.0.18
Maven 3.8.1
Ubuntu 22.034.2 LTS
Reporter: Armin Rahbar
Fix For: nifi-nar-maven-plugin-1.5.0
Commit e18d9ce added the flaky test testValidateJsonTimestamp in TestValidateRecord.java. The testValidateJsonTimestamp test fails because two individual tests inside testValidateJsonTimestamp are order dependent:
-Test with a timestamp that has an invalid format
-Test with an Inferred Schema.
You can produce the failure by running the test with NonDex maven plugin with the following command:
mvn -pl nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors edu.illinois:nondex-maven-plugin:2.1.1:nondex -Dtest=org.apache.nifi.processors.standard.TestValidateRecord#testValidateJsonTimestamp
When run with NonDex, testValidateJsonTimestamp test should run successfully, but instead, it results in the following failure:
TestValidateRecord.testValidateJsonTimestamp:549 expected: <1> but was: <0>
How to fix it:
Inside testValidateJsonTimestamp, reverse the order of these tests:
-Test with a timestamp that has an invalid format
-Test with an Inferred Schema.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)