Joe Witt created NIFI-8364:
------------------------------
Summary: TestQuerySolr is unreliable and needs to be reworked
Key: NIFI-8364
URL: https://issues.apache.org/jira/browse/NIFI-8364
Project: Apache NiFi
Issue Type: Task
Reporter: Joe Witt
As found in Github CI this test is unreliable:
https://github.com/apache/nifi/runs/2185571184?check_suite_focus=true
In looking at what failed we get
Error: Tests run: 17, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 9.28 s
<<< FAILURE! - in org.apache.nifi.processors.solr.TestQuerySolr
Error: testAllFacetCategories(org.apache.nifi.processors.solr.TestQuerySolr)
Time elapsed: 0.385 s <<< FAILURE!
java.lang.AssertionError: expected:<6> but was:<10>
at
org.apache.nifi.processors.solr.TestQuerySolr.testAllFacetCategories(TestQuerySolr.java:191)
Error: Failures:
Error: TestQuerySolr.testAllFacetCategories:191 expected:<6> but was:<10>
Error: Tests run: 64, Failures: 1, Errors: 0, Skipped: 0
In looking at the code we see a lot of concerns with the test.
- It appears to set the datetime as a static call. Not sure if this is great
for other tests or whether isolated. But such a practice should be avoided.
- the way it creates a client depends on target dir - seems problematic
- it inverts expected vs actual in many places including the failing line.
- it might be a candidate as a system test mroe than a unit test.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)