Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOLR-17650: Fix tests for unordered buffered updates #3197

Merged
merged 2 commits into from
Feb 25, 2025

Conversation

HoustonPutman
Copy link
Contributor

https://issues.apache.org/jira/browse/SOLR-17650

According to the discussion in the JIRA, the behavior here is fine. We just need to update the tests now that buffered updates can be done in parallel.

The new testing stuff is heavy handed, but mostly needed to 1) test this at all and 2) give us a good error message that we can actually use.

* @return The request response as a JSON String if the test matcher passes
*/
@SuppressWarnings("unchecked")
public static <T> String assertThatJQ(SolrQueryRequest req, String message, Matcher<T> test)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are adding more methods that uses the almost but not quite yet deprecated TestHarness. Can you please instead consider changing the approach of this method to look like org.apache.solr.SolrTestCaseHS#assertJQ which takes a SolrClient? Let's say you agree to do that. My next thought is... should SolrTestCase have such extensive utility methods or should they live on a helper class (a new one I guess). I lean to the latter but I haven't thought about that much yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about this, but the entire test is set up to use the test harness, so I wanted to implement this test to fit in with the surrounding tests as best as possible.

Adding one more convenience method to the test harness to fit the existing workflow I think is pretty minor compared to starting a whole new way for this test to behave. Deprecating the TestHarness (and actually removing it) is going to be a MAJOR ordeal, and honestly IMO changing a test to 1/2 use the test harness and 1/2 use something else will probably make that harder in the end.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fair

Copy link
Member

@markrmiller markrmiller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice PR!

@HoustonPutman HoustonPutman merged commit 0a50eda into apache:main Feb 25, 2025
2 of 3 checks passed
@HoustonPutman HoustonPutman deleted the buffered-updates-test branch February 25, 2025 15:16
HoustonPutman added a commit that referenced this pull request Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants