Skip to content
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

Unexpected error when testing project with jdk11 #947

Closed
Tomahna opened this issue Jun 30, 2019 · 12 comments
Closed

Unexpected error when testing project with jdk11 #947

Tomahna opened this issue Jun 30, 2019 · 12 comments
Assignees
Labels
bug A defect or misbehaviour. cli jdk task / test

Comments

@Tomahna
Copy link
Contributor

Tomahna commented Jun 30, 2019

Hello,

First thank for your efforts, bloop is definitely an awesome tools.

I'm trying to get bloop working with java 11, compilation works fine but on some projects tests fail to run.

System:
nixos on unstable channel
java openjdk 11.0.3-internal 2019-04-16
bloop 1.3.2+2-ac2e07ff

Reproducing it:

> sbt new scala/scala-seed.g8
> cd [project-name]
> sbt bloopInstall
> bloop test 
Compiling root (1 Scala source)
Compiled root (174ms)
Compiling root-test (1 Scala source)
Compiled root-test (378ms)
[E] Failed to initialize communication: jdk/internal/reflect/ConstructorAccessorImpl
[E] Internal error when running tests: sbt.ForkMain$Run$RunAborted: java.net.SocketException: Broken pipe (Write failed)
===============================================
Total duration: 0ms
No test suites were run.
===============================================

I experience this only on java 11, running it on java 8 works fine. Bloop is running as a systemd service. Note that this does not seem to occur on all projects. For example, on cats, bloop test coreJVM runs fine.

@jvican jvican added bug A defect or misbehaviour. cli labels Jul 1, 2019
@jvican jvican changed the title bloop test fail to run with jdk11 Bloop nailgun server doesn't work with jdk11 Jul 1, 2019
@jvican
Copy link
Contributor

jvican commented Jul 1, 2019

Hey @Tomahna, thanks for reporting! Yeah, unfortunately this bug fell through the crack because we're not testing Java 11 on our Nailgun infrastructure. I'll have a look into it.

@rtar
Copy link

rtar commented Jul 17, 2019

I had the same issue on JDK11, but I noticed that it always works fine if I launch bloop server from terminal, and does not work and fails with the error above if I use Xfce launcher.

I added env command to see what is the difference, and the only thing which was really different is PATH environment variable. I copy-pasted the one I had in terminal into bloop launcher script and it now works perfectly.

I do not know which entry exactly from PATH was to blame though.

@jvican
Copy link
Contributor

jvican commented Jul 17, 2019

That's great news! I'm honestly not sure why this is happening, whenever we add JDK11 to our testing infrastructure we'll see if this is an issue or not. If this isn't, I'll be closing it and instead tell people to look better into their Java installations.

Recommendations on how to improve the workflow of inspecting and setting JAVA_HOME while debugging this is welcome. Note that bloop about prints out the Java home used by the bloop server. If someone wants to brainstorm ideas, please do so either here or in Gitter.

@jvican jvican added the jdk label Jul 17, 2019
@Tomahna
Copy link
Contributor Author

Tomahna commented Jul 18, 2019

Note that I tested both on my workstation (nixos) and the one of a colleague (manjaro) and we both had the same issue even when launched from the command line with bloop server.

@rtar
Copy link

rtar commented Jul 23, 2019

It seems my path included JDK8, that why it worked. When JDK8 removed, I get the same error consistently.

@jvican
Copy link
Contributor

jvican commented Jul 23, 2019

Fixing this is a priority for the next release 1.3.3. Will keep you all posted, thanks for the comments and detailed explanations.

@jvican jvican self-assigned this Jul 23, 2019
@jvican
Copy link
Contributor

jvican commented Jul 29, 2019

Upstream nailgun ticket about supporting JDK 11, looks like we will need to make changes in our fork to support JDK 11. facebookarchive/nailgun#172

@jvican
Copy link
Contributor

jvican commented Jul 30, 2019

After a little bit more investigation, I can confirm this doesn't look like an issue caused by nailgun but by sbt's test interface. My guess is that if we've got this far with JDK 11 is that nailgun is indeed compatible with JDK 11. I will confirm this test by running tests on JDK 11 in our CI.

@jvican jvican changed the title Bloop nailgun server doesn't work with jdk11 Unexpected error when testing project with jdk11 Aug 8, 2019
@jvican jvican closed this as completed in 38bfe3f Aug 8, 2019
@Tomahna
Copy link
Contributor Author

Tomahna commented Aug 10, 2019

I can confirm that it works well with bloop v1.3.2+125-2d6bf327. Thanks @jvican for your hard work.

@mushtaq
Copy link

mushtaq commented Aug 10, 2019

@Tomahna curious how can I try v1.3.2+125-2d6bf327. I can use resolvers += Resolver.bintrayRepo("scalacenter", "releases") in plugins.sbt, but from where to download and install the bloop binary for CLI?

@Tomahna
Copy link
Contributor Author

Tomahna commented Aug 12, 2019

@mushtaq it depends on how you install bloop. If you install bloop on linux using the curl method. Instead of piping the install script to python, you can download it and run it with a version.
python install.py -v 1.3.2+125-2d6bf327 or something along these line.

@mushtaq
Copy link

mushtaq commented Aug 12, 2019

@Tomahna thanks!

CucumisSativus pushed a commit to CucumisSativus/bloop that referenced this issue Oct 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A defect or misbehaviour. cli jdk task / test
Projects
None yet
Development

No branches or pull requests

4 participants