[
https://issues.apache.org/jira/browse/SOLR-12555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16549242#comment-16549242
]
Jason Gerlowski commented on SOLR-12555:
----------------------------------------
That'd be great, thanks for volunteering to help [~barrotsteindev].
Pick any packages you'd like out of that list and post them here when you're
able to start working on them. (I attached a file above with the number of
tests per package, if that helps.) I'll do the same when I'm able to start in
on this myself (probably not till this weekend). I really don't think these
changes are particularly dangerous, but as flaky as Solr's tests are at the
moment, I was thinking we could break this into smaller commits that I'll make
with some time in between, so that it's easier to catch any test failures we
might introduce. We could aim to change around 30 tests in each commit. (If
you're up for doing more than that though, feel free. I can always break
things into chunks on my end before committing.)
> Replace try-fail-catch test patterns
> ------------------------------------
>
> Key: SOLR-12555
> URL: https://issues.apache.org/jira/browse/SOLR-12555
> Project: Solr
> Issue Type: Test
> Security Level: Public(Default Security Level. Issues are Public)
> Components: Tests
> Affects Versions: master (8.0)
> Reporter: Jason Gerlowski
> Assignee: Jason Gerlowski
> Priority: Trivial
> Attachments: SOLR-12555-sorted-by-package.txt, SOLR-12555.txt
>
>
> I recently added some test code through SOLR-12427 which used the following
> test anti-pattern:
> {code}
> try {
> actionExpectedToThrowException();
> fail("I expected this to throw an exception, but it didn't");
> catch (Exception e) {
> assertOnThrownException(e);
> }
> {code}
> Hoss (rightfully) objected that this should instead be written using the
> formulation below, which is clearer and more concise.
> {code}
> SolrException e = expectThrows(() -> {...});
> {code}
> We should remove many of these older formulations where it makes sense. Many
> of them were written before {{expectThrows}} was introduced, and having the
> old style assertions around makes it easier for them to continue creeping in.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]