[ https://issues.apache.org/jira/browse/SOLR-17651?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17938321#comment-17938321 ]
ASF subversion and git services commented on SOLR-17651: -------------------------------------------------------- Commit 85c3bb58723fb865d47694ecd327f56dc8030560 in solr's branch refs/heads/branch_9x from Pierre Salagnac [ https://gitbox.apache.org/repos/asf?p=solr.git;h=85c3bb58723 ] SOLR-17651: Make sure CLI unit tests don't call System.exit() (#3258) This introduces class ToolRuntime which is initiated and passed as a context for all CLI tools. When running tests, a sub-classes is used instead and blocks calls to System.exit(). > Obfuscate System.exit(), remove direct usage > -------------------------------------------- > > Key: SOLR-17651 > URL: https://issues.apache.org/jira/browse/SOLR-17651 > Project: Solr > Issue Type: Improvement > Components: cli, Tests > Reporter: Houston Putman > Assignee: Pierre Salagnac > Priority: Major > Labels: pull-request-available > Time Spent: 3h > Remaining Estimate: 0h > > In SOLR-17379, we are removing the {{TestSecurityManager}} defined in Lucene > that prohibits the usage of System.exit() in unit testing. This is important, > since gradle will fail with very little information when a test does a > System.exit() call. > In Solr, the CLI will use System.exit() to fail and show the user. This makes > sense as a CLI, but not in a unit test. It would be great if we could create > a utility that can be called in Solr to mimic System.exit(), but in unit > testing throw an exception instead. Then we could add System.exit() to > forbidden-apis, and ensure that our testing code won't run into this. -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org