You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Dawid Weiss (JIRA)" <ji...@apache.org> on 2012/05/10 12:52:10 UTC
[jira] [Created] (LUCENE-4047) Cleanup of LuceneTestCase
Dawid Weiss created LUCENE-4047:
-----------------------------------
Summary: Cleanup of LuceneTestCase
Key: LUCENE-4047
URL: https://issues.apache.org/jira/browse/LUCENE-4047
Project: Lucene - Java
Issue Type: Sub-task
Reporter: Dawid Weiss
Assignee: Dawid Weiss
Priority: Minor
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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Commented] (LUCENE-4047) Cleanup of LuceneTestCase
Posted by "Dawid Weiss (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-4047?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13274596#comment-13274596 ]
Dawid Weiss commented on LUCENE-4047:
-------------------------------------
Apologies for the noise -- jira issues (very long lags) and apparently no cookie token for submitting forms.
> 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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Resolved] (LUCENE-4047) Cleanup of LuceneTestCase
Posted by "Dawid Weiss (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-4047?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dawid Weiss resolved LUCENE-4047.
---------------------------------
Resolution: Fixed
> 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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Commented] (LUCENE-4047) Cleanup of LuceneTestCase
Posted by "Robert Muir (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-4047?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13274806#comment-13274806 ]
Robert Muir commented on LUCENE-4047:
-------------------------------------
{quote}
I assume the "unclosed directory" exception indicates more serious flaw in the test and this should be fixed first?
{quote}
I don't think thats the case here. I guess its unclear to me if this close-hide-throwable is only used
when the test is already going to fail anyway, and I see your point that today no closing happens, but
from my POV i just think we should not mask any exceptions coming from MDW.close().
If MDW.close() throws an exception because checkindex failed, this is really serious, and I don't
care what happened elsewhere in the test.
> 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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Updated] (LUCENE-4047) Cleanup of LuceneTestCase
Posted by "Dawid Weiss (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-4047?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dawid Weiss updated LUCENE-4047:
--------------------------------
Attachment: LUCENE-4047.patch
A patch with cleanups to LuceneTestCase. Most of the previous code blobs from before-after methods have been refactored into rules that have a single concern (there are exceptions).
I'd appreciate if folks could test against temporarily introduced bugs to check that the output indeed catches them and is consistent. It can be more verbose than previously (that is: more errors can be printed than before) because with rules you can push more than a single failure.
> 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, 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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Commented] (LUCENE-4047) Cleanup of LuceneTestCase
Posted by "Robert Muir (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-4047?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13274618#comment-13274618 ]
Robert Muir commented on LUCENE-4047:
-------------------------------------
At a glance, the rest of the patch looks great! I think just whenever we close an MDW, we should not be hiding any exceptions it throws, worst case we should wrap in runtime exception.
> 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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Commented] (LUCENE-4047) Cleanup of LuceneTestCase
Posted by "Robert Muir (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-4047?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13274615#comment-13274615 ]
Robert Muir commented on LUCENE-4047:
-------------------------------------
The DirectoryCloseable won't work: MockDirectoryWrapper checks for index corruption on close(),
we cannot just silently ignore Throwable from here.
> 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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Updated] (LUCENE-4047) Cleanup of LuceneTestCase
Posted by "Dawid Weiss (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-4047?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dawid Weiss updated LUCENE-4047:
--------------------------------
Attachment: LUCENE-4047.patch
A patch with cleanups to LuceneTestCase. Most of the previous code blobs from before-after methods have been refactored into rules that have a single concern (there are exceptions).
I'd appreciate if folks could test against temporarily introduced bugs to check that the output indeed catches them and is consistent. It can be more verbose than previously (that is: more errors can be printed than before) because with rules you can push more than a single failure.
> 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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Commented] (LUCENE-4047) Cleanup of LuceneTestCase
Posted by "Dawid Weiss (JIRA)" <ji...@apache.org>.
[ 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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Commented] (LUCENE-4047) Cleanup of LuceneTestCase
Posted by "Robert Muir (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-4047?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13274811#comment-13274811 ]
Robert Muir commented on LUCENE-4047:
-------------------------------------
And if you start to close MDW when tests have already failed, I'm not sure this
will provide a lot of benefits because MDW itself is really nothing at all but
a wrapper.
Chances are when a test has failed, closing the MDW will just immediately throw
an exception and not really accomplish anything, because MDW close() throws exception
if there are still open files in the directory it wraps. So nothing will really get
closed.
> 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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Updated] (LUCENE-4047) Cleanup of LuceneTestCase
Posted by "Dawid Weiss (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-4047?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dawid Weiss updated LUCENE-4047:
--------------------------------
Attachment: (was: LUCENE-4047.patch)
> 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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org