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

Zach Chen commented on LUCENE-9686:
-----------------------------------

Thanks [~julietibs]! 

Hi [~dweiss], thanks for reviewing! I took a second look at my patch, and 
realized that the randomization I added into the test case later has made it 
much less clear about the corner case the patch is handling here: seeking and 
reading an empty file. I just pushed a commit to update that.

With regard to throwing EOFException from *refill*, for typical file with size 
> 0, the EOFException can already be triggered inside *refill;* however, for 
file with size == 0, it may require some larger refactoring, mostly due to how 
*refill* is being called in both *seek* and *readByte*, and the internal 
*filePos* field that's being maintained. Let me spend some time to give it a 
try.

 

 

> TestDirectIODirectory#testFloatsUnderflow can fail assertion
> ------------------------------------------------------------
>
>                 Key: LUCENE-9686
>                 URL: https://issues.apache.org/jira/browse/LUCENE-9686
>             Project: Lucene - Core
>          Issue Type: Test
>            Reporter: Julie Tibshirani
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Reproduction line:
> {code}
> ./gradlew test --tests TestDirectIODirectory.testFloatsUnderflow 
> -Dtests.seed=73B56EAB13269C91 -Dtests.slow=true -Dtests.badapples=true 
> -Dtests.locale=haw-US -Dtests.timezone=America/Inuvik -Dtests.asserts=true 
> -Dtests.file.encoding=UTF-8
> {code}
> I didn't have the chance to look deeply, but it seems like the wrong 
> exception type is being thrown:
> {code:java}
>  junit.framework.AssertionFailedError: Unexpected exception type, expected 
> EOFException but got java.nio.BufferUnderflowException
>         at 
> __randomizedtesting.SeedInfo.seed([73B56EAB13269C91:1FD75ACA1CD83E9C]:0)
>         at 
> org.apache.lucene.util.LuceneTestCase.expectThrows(LuceneTestCase.java:2895)
>         at 
> org.apache.lucene.util.LuceneTestCase.expectThrows(LuceneTestCase.java:2876)
>         at 
> org.apache.lucene.store.BaseDirectoryTestCase.testFloatsUnderflow(BaseDirectoryTestCase.java:291)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to