You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2021/03/25 16:39:00 UTC

[jira] [Commented] (NIFI-8364) TestQuerySolr is unreliable and needs to be reworked

    [ https://issues.apache.org/jira/browse/NIFI-8364?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17308806#comment-17308806 ] 

ASF subversion and git services commented on NIFI-8364:
-------------------------------------------------------

Commit 54d2222fb0054c263049ff83653d4ba2d29e439f in nifi's branch refs/heads/main from David Handermann
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=54d2222 ]

NIFI-8364 This closes #4935. Refactored TestQuerySolr and TestGetSolr to reuse embedded SolrClient

- Replaced Gson with Jackson for parsing JSON
- Corrected assertion argument ordering
- Simplified relative path determination for EmbeddedSolrServerFactory
- Replaced SimpleDateFormat with java.time.Instant parsing and formatting

Signed-off-by: Joe Witt <jo...@apache.org>


> 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
>            Assignee: David Handermann
>            Priority: Major
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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)