[
https://issues.apache.org/jira/browse/LUCENE-9158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17020676#comment-17020676
]
Robert Muir commented on LUCENE-9158:
-------------------------------------
I only meant: we had to start somewhere with a patch. This patch is just a jira
attachment, so it hasn't broken any CI builds, since we haven't committed any
changes. If we need fancy stuff for CI, that's OK, let's fix it.
{quote}
Works perfectly, I do this all the time. We fixed Solr long ago to use random
port numbers for jetty (bind to 0). Of course I did not ran all tests, but
looks correct.
{quote}
If this is really the case, let's enforce it in the test policy files?
The default java system policy configuration
({{$JAVA_HOME/conf/security/java.policy}}) already allows listening to dynamic
ports, so we shouldn't have any {{listen}} lines in our policy files? (we only
need {{accept}} to allow it to work)
{code}
// default permissions granted to all domains
grant {
// allows anyone to listen on dynamic ports
permission java.net.SocketPermission "localhost:0", "listen";
...
{code}
If we remove the unnecessary {{listen}} permissions, then any bad tests
listening on hardcoded ports will fail. Plus it will prevent any such tests
from creeping back in.
> Fix tests to respect java.io.tmpdir by default
> ----------------------------------------------
>
> Key: LUCENE-9158
> URL: https://issues.apache.org/jira/browse/LUCENE-9158
> Project: Lucene - Core
> Issue Type: Improvement
> Components: general/test
> Reporter: Robert Muir
> Priority: Major
> Attachments: LUCENE-9158.patch
>
>
> Currently the tests destroy your SSDs by writing temp test data to
> {{build/test/}} in your checkout.
> It would be better to respect {{java.io.tmpdir}} for where all the temporary
> files get written. This way, if someone has configured their
> system/environment variables appropriately, it won't destroy SSD.
> On linux it may work by default in many cases, as a lot of linux systems
> mount {{/tmp}} on tmpfs by default.
> On windows users could have created a [RAM
> drive|https://en.wikipedia.org/wiki/List_of_RAM_drive_software] such as
> {{R:}} and have {{TMP}} environment variable pointed at it, we should respect
> that.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]