[
https://issues.apache.org/jira/browse/SOLR-14217?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Robert Muir updated SOLR-14217:
-------------------------------
Attachment: SOLR-14217.patch
> tests respect tests.workDir correctly (prevent SSD destruction)
> ---------------------------------------------------------------
>
> Key: SOLR-14217
> URL: https://issues.apache.org/jira/browse/SOLR-14217
> Project: Solr
> Issue Type: Bug
> Security Level: Public(Default Security Level. Issues are Public)
> Components: Tests
> Reporter: Robert Muir
> Priority: Major
> Attachments: SOLR-14217.patch
>
>
> To prevent SSD destruction you should be able to set in your
> {{gradle.properties}}:
> {code}
> tests.workDir=/tmp/lucene_gradle
> {code}
> This causes all tests to write their temporary stuff (e.g. indexes) to that
> location, instead of build/ directories inside the checkout.
> Unfortunately if you do this, some solr tests fail, because their configs
> will then try to reach out to invalid places. It happens because they load up
> configuration files with logic that looks like this:
> {code}
> <lib dir="${solr.install.dir:../../../..}/contrib/extraction/lib"
> regex=".*\.jar" />
> {code}
> Because {{solr.install.dir}} is not set, it falls back to an inappropriate
> relative path, and tries to access bogus locations on the filesystem, causing
> tests to fail:
> {noformat}
> 2> Caused by: org.apache.solr.common.SolrException: Error loading solr
> config from
> /tmp/lucene_gradle/solr.client.solrj.embedded.SolrExampleJettyTest_FF93943C1C04FCAC-001/tempDir-001/collection1/conf/solrconfig.xml
> 2> at
> org.apache.solr.core.SolrConfig.readFromResourceLoader(SolrConfig.java:157)
> 2> at
> org.apache.solr.core.ConfigSetService.createSolrConfig(ConfigSetService.java:111)
> 2> at
> org.apache.solr.core.ConfigSetService.loadConfigSet(ConfigSetService.java:82)
> 2> ... 8 more
> 2> Caused by: java.security.AccessControlException: access denied
> ("java.io.FilePermission"
> "/tmp/lucene_gradle/solr.client.solrj.embedded.SolrExampleJettyTest_FF93943C1C04FCAC-001/tempDir-001/collection1/../../../../contrib/extraction/lib"
> "read")
> 2> at
> java.base/java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
> 2> at
> java.base/java.security.AccessController.checkPermission(AccessController.java:1036)
> 2> at
> java.base/java.lang.SecurityManager.checkPermission(SecurityManager.java:408)
> 2> at
> java.base/java.lang.SecurityManager.checkRead(SecurityManager.java:747)
> 2> at java.base/sun.nio.fs.UnixPath.checkRead(UnixPath.java:818)
> 2> at
> java.base/sun.nio.fs.UnixFileSystemProvider.newDirectoryStream(UnixFileSystemProvider.java:399)
> 2> at java.base/java.nio.file.Files.newDirectoryStream(Files.java:607)
> 2> at
> org.apache.solr.core.SolrResourceLoader.getURLs(SolrResourceLoader.java:286)
> 2> at
> org.apache.solr.core.SolrResourceLoader.getFilteredURLs(SolrResourceLoader.java:319)
> 2> at org.apache.solr.core.SolrConfig.initLibs(SolrConfig.java:782)
> 2> at org.apache.solr.core.SolrConfig.<init>(SolrConfig.java:176)
> 2> at
> org.apache.solr.core.SolrConfig.readFromResourceLoader(SolrConfig.java:149)
> 2> ... 10 more
> {noformat}
> The system property must be set so that these tests will work with the
> configured tests.workDir
> It has no impact on tests speed, because solr tests are all sitting in
> Thread.sleep, not bottlenecked on anything related to this.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]