Skip to content

Test fail because of _JAVA_OPTIONS #4143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jendrikw opened this issue Mar 20, 2018 · 3 comments
Closed

Test fail because of _JAVA_OPTIONS #4143

jendrikw opened this issue Mar 20, 2018 · 3 comments
Assignees

Comments

@jendrikw
Copy link

I have set up _JAVA_OPTIONS in /etc/environment to fix font rendering IntelliJ.

#
# This file is parsed by pam_env module
#
# Syntax: simple "KEY=VAL" pairs on separate lines
#

# java font anti aliasing
_JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=lcd'

For example, running testCompilation enum-List1 fails, because there is an extra line in stderr.

[warn] Multiple main classes detected.  Run 'show discoveredMainClasses' to see the list
[warn] Multiple main classes detected.  Run 'show discoveredMainClasses' to see the list
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=lcd
[info] Test run started
[info] Test dotty.tools.dotc.CompilationTests.runAll started
Output from 'tests/run/enum-List1.scala' did not match check file.
Diff (expected on the left, actual right):
Cons(1,Cons(2,Cons(3,Nil())))  |  Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=lcd
EOF                            |  Cons(1,Cons(2,Cons(3,Nil())))
                               |  EOF

[=======================================] completed (1/1, 51s)  
[error] Test dotty.tools.dotc.CompilationTests.runAll failed: java.lang.AssertionError: Run test failed, but should not, reasons:
[error] , took 53.515 sec
[error]     at dotty.tools.vulpix.ParallelTesting$CompilationTest.checkRuns(ParallelTesting.scala:993)
[error]     at dotty.tools.dotc.CompilationTests.runAll(CompilationTests.scala:199)
[error]     ...
[info] Test dotty.tools.dotc.CompilationTests.compileNeg started
No files matched "enum-List1" in test                                           
[info] Test dotty.tools.dotc.CompilationTests.compilePos started
No files matched "enum-List1" in test                                           
[info] Test dotty.tools.dotc.CompilationTests.testPickling started
No files matched "enum-List1" in test                                           
[info] Test dotty.tools.dotc.CompilationTests.tastyBootstrap started
No files matched "enum-List1" in test                                           
No files matched "enum-List1" in test                                           
No files matched "enum-List1" in test                                           
No files matched "enum-List1" in test                                           
[info] Test dotty.tools.dotc.CompilationTests.posTwice started
No files matched "enum-List1" in test                                           
[info] Test dotty.tools.dotc.CompilationTests.genericJavaSignatures started
No files matched "enum-List1" in test                                           

================================================================================
Test Report
================================================================================

0 passed, 1 failed, 1 total
    tests/run/enum-List1.scala failed


--------------------------------------------------------------------------------
Note - reproduction instructions have been dumped to log file:
    /home/jendrik/dev/scala/dotty/testlogs/tests-2018-03-20/tests-2018-03-20-09:18:29.log
--------------------------------------------------------------------------------
[info] Test run finished: 1 failed, 0 ignored, 7 total, 62.838s
[error] Failed: Total 7, Failed 1, Errors 0, Passed 6
[error] Failed tests:
[error] 	dotty.tools.dotc.CompilationTests
[error] (dotty-compiler/test:testOnly) sbt.TestsFailedException: Tests unsuccessful
[error] Total time: 97 s, completed 20-Mar-2018 09:19:31

I browsed the issues and found #1712, which is basically the same. A filter file like discussed in that issue would fix this, but it looks like the filter is not applied for compilationTest.

@nicolasstucki
Copy link
Contributor

We cannot disable remove the eviroment variable from within the JVM instance. A simple workaround (like we did in the past for the CI) is to unset it before launching SBT.

> unset _JAVA_OPTIONS
> sbt

@jendrikw
Copy link
Author

jendrikw commented Apr 3, 2018

It is not possible to remove these lines from the output before comparing them?

@nicolasstucki
Copy link
Contributor

That could be a possibility.

@nicolasstucki nicolasstucki self-assigned this Apr 3, 2018
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Apr 4, 2018
nicolasstucki added a commit that referenced this issue Apr 4, 2018
Fix #4143: Ignore lines "Picked up _JAVA_OPTIONS" in tests
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Apr 5, 2018
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Apr 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants