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

Dawid Weiss commented on LUCENE-4047:
-------------------------------------

bq. The DirectoryCloseable won't work: MockDirectoryWrapper checks for index 
corruption on close(),
we cannot just silently ignore Throwable from here

This only happens if the directory is not closed -- it should always be closed 
so appropriate exception would be thrown at that time. I assume the "unclosed 
directory" exception indicates more serious flaw in the test and this should be 
fixed first?

We can change it to propagate both unclosed and any potential other exception 
but this will only increase the amount of logs to be reviewed.

Also note that prior to this patch directories were not closed at all if 
anything failed --
{code}
      if (!testsFailed) {
        checkResourcesAfterClass(); 
{code}

I think this is already better in that resources are always closed, regardless 
of any previous errors?


                
> Cleanup of LuceneTestCase
> -------------------------
>
>                 Key: LUCENE-4047
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4047
>             Project: Lucene - Java
>          Issue Type: Sub-task
>          Components: general/build, general/test
>            Reporter: Dawid Weiss
>            Assignee: Dawid Weiss
>            Priority: Minor
>             Fix For: 4.0
>
>         Attachments: LUCENE-4047.patch
>
>
> functionally split large blocks of code that do logically different things, 
> organize and order them into rules. Use RandomizedRunner facilities for 
> ensuring scope resources (Directory, temporary folders) are properly disposed 
> of. Use RandomizedRunner facilities for reporting reproduce message.
> I have a working branch for this at github. Polishing off the rough edges.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to