[ 
https://issues.apache.org/jira/browse/LUCENE-10457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17502623#comment-17502623
 ] 

Robert Muir commented on LUCENE-10457:
--------------------------------------

I don't think createTempDir should do this. It should just create a temporary 
directory.

also i don't think we should randomly create symlinks anywhere as a helper for 
our tests. we should suffer the complexity of fixing all tests to deal with 
symbolic links when lucene doesn't itself create any symbolic links. It would 
just be useless noise effort.

If you want to use symlinks for your own test (because your subclasses create 
symbolic links), it is easy:
{noformat}
Path sandbox = createTempDir("mystuff");
Files.createDirectory(sandbox.resolve("mydir"));
Files.createSymbolicLink(sandbox.resolve("mylink"), sandbox.resolve("mydir"));
{noformat}



> LuceneTestCase.createTempDir could randomly return symbolic links
> -----------------------------------------------------------------
>
>                 Key: LUCENE-10457
>                 URL: https://issues.apache.org/jira/browse/LUCENE-10457
>             Project: Lucene - Core
>          Issue Type: Task
>          Components: general/test
>            Reporter: Mike Drob
>            Priority: Major
>
> When we are creating temporary directories to use for other Lucene functions, 
> we could occasionally provide symbolic links instead of direct references to 
> directories. If the system running tests doesn't support symbolic links, then 
> we should ignore this option.
> Providing links would be useful to test scenarios for example where users 
> have a symbolic link for the "current" index directory and then rotate that 
> over time but applications still use the same link.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to