[ 
https://issues.apache.org/jira/browse/SOLR-4195?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hoss Man updated SOLR-4195:
---------------------------

    Attachment: SOLR-4195.patch


Here's a patch i've been experimenting with.  It was not as trivial as i 
originally thought, because if we make the files read-only, then "ant clean" 
gets more complicated.

It did in fact uncover a test that was writing to the "global" solr home dir, 
which is also fixed in the patch to make a copy.

Would love to see feedback on this.  my two chief concerns are:

 * did i cover all of the necessary ant paths for when/how this build/... dir 
might be "cleaned" ?
 * should we worry more about how/when tests want to copy these files and what 
the umask is of users running the tests?  specifically: should we add a special 
utility for cloning the home dir and explicitly setting the props to 
read+write? (not really sure how likely it is someone would ever have their 
umask set prevent themselves from writing to new files they create -- i'm 
guessing lots of other places in our ant build would break long before these 
tests)


                
> chmod a-x build/**/test-files when running tests
> ------------------------------------------------
>
>                 Key: SOLR-4195
>                 URL: https://issues.apache.org/jira/browse/SOLR-4195
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Hoss Man
>         Attachments: SOLR-4195.patch
>
>
> Until recently, I thought the solr test framework was setup such that every 
> test got it's own copy of the "test-files/solr" directory to use as it's Solr 
> Home Dir -- then mark committed r1421543, to fix a problem where that test 
> was writing a file (that would later be removed) to the solr conf dir, which 
> would confuse another currently running test and cause it to fail.
> This made me realize that what i was remembering is that the ant build files 
> copy the src/test-files directories into build/ prior to running the tests -- 
> but all tests (in that module) still share the same copy.
> Subsequent discussions with folks on IRC lead me to the following 
> realizations..
>  * making a copy of the test-files dir for each test would help eliminate 
> confusing by reducing non-reproducible failures if tests collide -- but might 
> be slow
>  * making a copy of the test-files dir for each test would not help identify 
> situations were code was mistakenly/unexpectedly writing to the solr home dir
>  * what would probably make the most sense, would be to make the 
> build/test-files directory "read only".  that way by default tests would get 
> a read only solr home dir -- triggering failures if the code is broken and 
> tries to write to that dir.  tests that want/need to write to the solr home 
> dir would have to go out of their way to clone the read only test-files/solr 
> directory and use it as their solr home.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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

Reply via email to