[
https://issues.apache.org/jira/browse/LUCENE-4982?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Shai Erera updated LUCENE-4982:
-------------------------------
Attachment: LUCENE-4982.patch
I changed the check to {{freeSpace < len}}, but then the test failed to trip
disk-full the second time, unless I call out.flush() in between. Debugging
tells me that RAMOutputStream sets RAMFile.length only on flush(), therefore
even if I attempt to write a 2K byte[] (with maxSize=2), the test doesn't fail.
Seems like getRecomputedActualSizeInBytes is not very useful, since if the Dir
is not RAMDir, it just calls sizeInBytes() which computes the size from the
file-system, and if it is, then RAMFile.length isn't up-to-date, leading to
incorrect (0) size computed, unless some files were flushed already.
But getRecomputed cannot flush the streams either in that case ...
So I think I'll leave the test like that. In a real test which wants to trip on
disk-full, it will usually involve indexing, hence files will be flushed and
recomputed will return some number, not really the actual number of bytes used,
but some number.
> Make MockIndexOutputWrapper check disk full on copyBytes
> --------------------------------------------------------
>
> Key: LUCENE-4982
> URL: https://issues.apache.org/jira/browse/LUCENE-4982
> Project: Lucene - Core
> Issue Type: Improvement
> Components: modules/test-framework
> Reporter: Shai Erera
> Assignee: Shai Erera
> Attachments: LUCENE-4982.patch, LUCENE-4982.patch, LUCENE-4982.patch
>
>
> While working on the consistency test for Replicator (LUCENE-4975), I noticed
> that I don't trip disk-full exceptions and tracked it down to
> MockIndexOutputWrapper.copyBytes not doing these checks like writeBytes. I'd
> like to add this check.
--
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: [email protected]
For additional commands, e-mail: [email protected]