Hi, I am new to Solr sources and I was digging in facet tests.
I found unreasonable block of code in TestFaceting.testFacets:
This code adds second document, never commits and executes second query with q=id:1 again.
So test will pass even if:
1) Change assertions to ID's not related to 2nd document (like 2001)
2) Add commit after 2nd document added (still filter is set to id:1)
3) Remove at all creating 2nd document.
Patch changes test flow to fallowing:
1) add document1 and commit
2) assert facets to query :
3) add document2 and commit
5) assert query : to have facetes with values 1 and 2 when expected