You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "serhiy-bzhezytskyy (via GitHub)" <gi...@apache.org> on 2026/08/21 16:34:44 UTC

[PR] SOLR-18354: Remove SolrTestCaseJ4.ignoreException/unIgnoreException/resetExceptionIgnores [solr]

serhiy-bzhezytskyy opened a new pull request, #4787:
URL: https://github.com/apache/solr/pull/4787

   https://issues.apache.org/jira/browse/SOLR-18354
   
   Removed the deprecated `SolrTestCaseJ4.ignoreException(String)`, `unIgnoreException(String)`, and `resetExceptionIgnores()`, replacing every caller with `ErrorLogMuter` (`try (ErrorLogMuter muter = ErrorLogMuter.regex("pattern")) { ... }`).
   
   This ended up touching ~70 files, not just `SolrTestCaseJ4` itself -- the deprecated methods were baked into the base class's own `@BeforeClass`/`@AfterClass`/`initCore()` lifecycle, and `ErrorLogMuter` (scoped, `AutoCloseable`) has no equivalent for the old API's shared-map "reset everything" convenience, so each call site needed reading rather than a mechanical rename. A few things worth calling out:
   
   - `SolrTestCaseJ4` now holds a single `ignoreExceptionMuter` field (created in `setupTestCases()`/`initCore()`, closed in `teardownTestCases()`) instead of the shared `errorMuters` map, with a defensive close-if-leaked check at the start of `setupTestCases()` to preserve the one bit of robustness the old blanket reset gave for free (cleanup if a previous test class failed to tear down cleanly).
   - Found and fixed a stray-character typo along the way: `TestConfigSetsAPI` had `unIgnoreException("already exists\`")` (extra backtick) which meant that particular un-ignore never actually matched its `ignoreException("already exists")` -- a silent no-op in the deprecated API that's structurally impossible once both ends reference the same `ErrorLogMuter` instance.
   - Added a changelog entry: `solr-test-framework` is a published Maven artifact and these were `public static` methods, so this is a real API break for downstream test code, not purely internal.
   
   Verified with a full-repo `./gradlew compileTestJava` (confirms no caller was missed anywhere in the tree) plus targeted test runs across every lifecycle path touched (single-node, cursor, distributed/cloud, lock-on-startup, etc.).
   
   cc @dsmiley @epugh @janhoy
   
   AI-assisted (Claude Sonnet 5)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-18354: Remove SolrTestCaseJ4.ignoreException/unIgnoreException/resetExceptionIgnores [solr]

Posted by "serhiy-bzhezytskyy (via GitHub)" <gi...@apache.org>.
serhiy-bzhezytskyy commented on PR #4787:
URL: https://github.com/apache/solr/pull/4787#issuecomment-5379971179

   `ErrorLogMuter` is a plain `Closeable`, not enforced try-with-resources -- you can do `var muter = ErrorLogMuter.regex(...); ...; muter.close();` for the exact old ignore/un-ignore statement-pair feel, no nesting needed. Trade-off is losing the auto-cleanup-on-exception guarantee try-with-resources gives.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-18354: Remove SolrTestCaseJ4.ignoreException/unIgnoreException/resetExceptionIgnores [solr]

Posted by "epugh (via GitHub)" <gi...@apache.org>.
epugh commented on PR #4787:
URL: https://github.com/apache/solr/pull/4787#issuecomment-5373180999

   Curious what others think of this change?   I am not sure I love it..  I mean, maybe it's the only way, but I see a bunch of try nesting.  I think I liked the older statemetn style of "Ignore this thing that happens below"....


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


Re: [PR] SOLR-18354: Remove SolrTestCaseJ4.ignoreException/unIgnoreException/resetExceptionIgnores [solr]

Posted by "dsmiley (via GitHub)" <gi...@apache.org>.
dsmiley merged PR #4787:
URL: https://github.com/apache/solr/pull/4787


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org