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

Dawid Weiss commented on LUCENE-10528:
--------------------------------------

Hmm... But we want to run this test occasionally, don't we? If we disable it 
completely then it will stop testing if Luke can be actually launched (and 
nothing fails). The reason why it passes in headless mode is because in 
headless mode LukeMain exits if it detects it:
{code}
    if (sanityCheck && GraphicsEnvironment.isHeadless()) {
      Logger.getGlobal().log(Level.SEVERE, "[Vader] Hello, Luke. Can't do much 
in headless mode.");
      Runtime.getRuntime().exit(0);
    }
{code}

We can provide a test annotation group that would be enabled by default but 
could be explicitly turned off via gradle.properties. Something like 
RequiresGraphicsEnvironment?


> TestScripts.testLukeCanBeLaunched creates X Window when running the tests
> -------------------------------------------------------------------------
>
>                 Key: LUCENE-10528
>                 URL: https://issues.apache.org/jira/browse/LUCENE-10528
>             Project: Lucene - Core
>          Issue Type: Task
>            Reporter: Robert Muir
>            Priority: Major
>
> When running the tests, this one causes my entire desktop to "flicker" when 
> it creates some kind of X-Window very quickly and then destroys it. I use 
> tiling window manager, so whole desktop gets rearranged for a split second, 
> and I'd rather it not happen :)
> I first tried adding -Djava.awt.headless=true to both org.gradle.jvmargs and 
> tests.jvmargs in my .gradle/gradle.properties. doesn't work, as the test 
> doesnt use these when launching luke.
> I next tried hacking the test by adding this to the ProcessBuilderThingy, but 
> it didn't help either:
> {noformat}
> .envvar("LAUNCH_OPTS", "-Djava.awt.headless=true")
> {noformat}
> One way I can work around it, is to unset {{DISPLAY}} env var so that it 
> won't create this window. test still passes:
> {noformat}
> $ unset DISPLAY
> $ ./gradlew :lucene:distribution.tests:test
> ... (no window gets created)
> {noformat}
> So maybe as a workaround, we can just not pass DISPLAY environment variable 
> through to this test?



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

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

Reply via email to