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

Robert Muir commented on LUCENE-9083:
-------------------------------------

The test uses a "mock" filesystem that remaps requests to {{/dev}} and {{/sys}} 
to ordinary files for testing purposes. This way various system configurations 
can be simulated easily

The mock asks nicely not to do anything crazy:
{quote}
It is hacky by definition, so don't try putting it around a complex chain or 
anything.
{quote}

I think trying to run the tests from /dev itself counts :)
Let's add an assumption rather than have it recurse infinitely and stack 
overflow:

{noformat}
$ ant test -Dtestcase=TestIOUtils -Dtests.workDir=/dev/shm/too_crazy

...

   [junit4] Started J0 PID(229438@localhost).
   [junit4] Suite: org.apache.lucene.util.TestIOUtils
   [junit4] IGNOR/A 0.03s | TestIOUtils.testNVME
   [junit4]    > Assumption #1: can't mock /sys and /dev inside of /sys or /dev!
   [junit4] OK      0.00s | TestIOUtils.testFsyncDirectory
   [junit4] IGNOR/A 0.01s | TestIOUtils.testSymlinkSSD
   [junit4]    > Assumption #1: can't mock /sys and /dev inside of /sys or /dev!
   [junit4] OK      0.00s | TestIOUtils.testFsyncNonExistentDirectory
   [junit4] OK      0.00s | TestIOUtils.testDeleteFileIgnoringExceptions
   [junit4] OK      0.01s | TestIOUtils.testApplyToAll
   [junit4] OK      0.00s | TestIOUtils.testFsyncFile
   [junit4] OK      0.01s | TestIOUtils.testFsyncAccessDeniedOpeningDirectory
   [junit4] OK      0.00s | TestIOUtils.testDontDeleteDoesntExist
   [junit4] OK      0.01s | TestIOUtils.testDeleteTwoFilesIfExist
   [junit4] OK      0.01s | TestIOUtils.testDeleteFileIfExists
   [junit4] IGNOR/A 0.01s | TestIOUtils.testNfsSpins
   [junit4]    > Assumption #1: can't mock /sys and /dev inside of /sys or /dev!
   [junit4] IGNOR/A 0.01s | TestIOUtils.testSSD
   [junit4]    > Assumption #1: can't mock /sys and /dev inside of /sys or /dev!
   [junit4] OK      0.01s | TestIOUtils.testSpinsBasics
   [junit4] IGNOR/A 0.01s | TestIOUtils.testManyPartitions
   [junit4]    > Assumption #1: can't mock /sys and /dev inside of /sys or /dev!
   [junit4] OK      0.01s | TestIOUtils.testDeleteTwoFilesIgnoringExceptions
   [junit4] OK      0.00s | TestIOUtils.testDontDeleteFileIgnoringExceptions
   [junit4] IGNOR/A 0.01s | TestIOUtils.testRotatingPlatters
   [junit4]    > Assumption #1: can't mock /sys and /dev inside of /sys or /dev!
   [junit4] IGNOR/A 0.00s | TestIOUtils.testTmpfsDoesntSpin
   [junit4]    > Assumption #1: can't mock /sys and /dev inside of /sys or /dev!
   [junit4] IGNOR/A 0.01s | TestIOUtils.testGetFileStore
   [junit4]    > Assumption #1: can't mock /sys and /dev inside of /sys or /dev!
   [junit4] OK      0.00s | TestIOUtils.testGetMountPoint
   [junit4] Completed [1/1] in 0.38s, 21 tests, 8 skipped
{noformat}



> TestIOUtils false failures on Linux due to StackOverflowError when Lucene is 
> installed under /dev/shm
> -----------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-9083
>                 URL: https://issues.apache.org/jira/browse/LUCENE-9083
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: core/store
>    Affects Versions: master (9.0)
>            Reporter: Michael McCandless
>            Priority: Major
>
> I'm testing Lucene's performance on the new 
> [Graviton2|https://aws.amazon.com/about-aws/whats-new/2019/12/announcing-new-amazon-ec2-m6g-c6g-and-r6g-instances-powered-by-next-generation-arm-based-aws-graviton2-processors]
>  ARM EC2 instances, specifically on an {{m6g.8xlarge}} instance.
> But several test cases in {{TestIOUtils}} failed due to 
> {{StackOverflowError}}, e.g.:
> {noformat}
>    [junit4] <JUnit4> says aloha! Master seed: 7AF4595BAD680884
>    [junit4] Executing 1 suite with 1 JVM.
>    [junit4]
>    [junit4] Started J0 PID(28011@localhost).
>    [junit4] Suite: org.apache.lucene.util.TestIOUtils
>    [junit4] OK      0.03s | TestIOUtils.testDeleteFileIgnoringExceptions
>    [junit4]   2> NOTE: reproduce with: ant test  -Dtestcase=TestIOUtils 
> -Dtests.method=testRotatingPlatters -Dtests.seed=7AF4595BAD680884 
> -Dtests.slow=true -Dtests.badapples=true -D\
> tests.locale=lu -Dtests.timezone=America/Lower_Princes -Dtests.asserts=true 
> -Dtests.file.encoding=US-ASCII
>    [junit4] ERROR   65.1s | TestIOUtils.testRotatingPlatters <<<
>    [junit4]    > Throwable #1: java.lang.StackOverflowError
>    [junit4]    >        at 
> __randomizedtesting.SeedInfo.seed([7AF4595BAD680884:ADC8742ECA7CAFC1]:0)
>    [junit4]    >        at 
> java.base/sun.nio.cs.UTF_8$Encoder.encodeLoop(UTF_8.java:564)
>    [junit4]    >        at 
> java.base/java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:576)
>    [junit4]    >        at 
> java.base/sun.nio.fs.UnixPath.encode(UnixPath.java:136)
>    [junit4]    >        at 
> java.base/sun.nio.fs.UnixPath.<init>(UnixPath.java:69)
>    [junit4]    >        at 
> java.base/sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:280)
>    [junit4]    >        at 
> java.base/java.nio.file.Path.startsWith(Path.java:379)
>    [junit4]    >        at 
> org.apache.lucene.mockfile.FilterPath.startsWith(FilterPath.java:130)
>    [junit4]    >        at 
> org.apache.lucene.util.TestIOUtils$MockLinuxFileSystemProvider.maybeChroot(TestIOUtils.java:246)
>    [junit4]    >        at 
> org.apache.lucene.util.TestIOUtils$MockLinuxFileSystemProvider$MockLinuxPath.toRealPath(TestIOUtils.java:266)
>    [junit4]    >        at 
> org.apache.lucene.util.TestIOUtils$MockLinuxFileSystemProvider$MockLinuxPath.toRealPath(TestIOUtils.java:270)
>    [junit4]    >        at 
> org.apache.lucene.util.TestIOUtils$MockLinuxFileSystemProvider$MockLinuxPath.toRealPath(TestIOUtils.java:270)
>    [junit4]    >        at 
> org.apache.lucene.util.TestIOUtils$MockLinuxFileSystemProvider$MockLinuxPath.toRealPath(TestIOUtils.java:270)
> {noformat}
> Also, I've installed Lucene on {{tmpfs}} ({{/dev/shm}}), and maybe that (and 
> not ARM Linux) is to blame?  Maybe it's just a silly bug in the 
> {{MockLinuxPath}} in {{TestIOUtils.java}} .. it calls {{maybeChroot}} which 
> looks to special case any path starting with {{/dev}} ... I'll try Lucene on 
> {{/dev/shm}} on an x64 Linux to see ... all other core tests seem to pass at 
> least once!
> I'm using OpenJDK11 build from https://adoptopenjdk.net



--
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