Test runner that sets System.err causes Bloop server to become unresponsive
See original GitHub issueUsing a native-image of bloopgun, I’m unable to run bloop exit
❯ bloop exit
error: Unexpected error forces client exit!
java.io.EOFException
at java.io.DataInputStream.readInt(DataInputStream.java:397)
at bloop.shaded.snailgun.protocol.Protocol.$anonfun$processChunkFromServer$1(Protocol.scala:181)
at scala.util.Try$.apply(Try.scala:213)
at bloop.shaded.snailgun.protocol.Protocol.processChunkFromServer(Protocol.scala:180)
at bloop.shaded.snailgun.protocol.Protocol.sendCommand(Protocol.scala:108)
at bloop.shaded.snailgun.TcpClient.run(TcpClient.scala:34)
at bloop.bloopgun.BloopgunCli.executeCmd$1(Bloopgun.scala:255)
at bloop.bloopgun.BloopgunCli.fireCommand(Bloopgun.scala:261)
at bloop.bloopgun.BloopgunCli.run(Bloopgun.scala:216)
at bloop.bloopgun.Bloopgun$.main(Bloopgun.scala:560)
at bloop.bloopgun.Bloopgun.main(Bloopgun.scala)
After running this command once, I’m unable to communicate with the Bloop server with other commands
❯ bloop help
error: Unexpected error forces client exit!
java.io.EOFException
at java.io.DataInputStream.readInt(DataInputStream.java:397)
at bloop.shaded.snailgun.protocol.Protocol.$anonfun$processChunkFromServer$1(Protocol.scala:181)
at scala.util.Try$.apply(Try.scala:213)
at bloop.shaded.snailgun.protocol.Protocol.processChunkFromServer(Protocol.scala:180)
at bloop.shaded.snailgun.protocol.Protocol.sendCommand(Protocol.scala:108)
at bloop.shaded.snailgun.TcpClient.run(TcpClient.scala:34)
at bloop.bloopgun.BloopgunCli.executeCmd$1(Bloopgun.scala:255)
at bloop.bloopgun.BloopgunCli.fireCommand(Bloopgun.scala:261)
at bloop.bloopgun.BloopgunCli.run(Bloopgun.scala:216)
at bloop.bloopgun.Bloopgun$.main(Bloopgun.scala:560)
at bloop.bloopgun.Bloopgun.main(Bloopgun.scala)
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
scalacenter/bloop - Gitter
Hey, seem to be having issues with Bloop when running scala-cli scripts in CI, two different errors that seem to be related to...
Read more >Performance guide · Bloop - Scala Center
Get familiar with the performance characteristics of project builds; Compare the performance of Bloop with that of other tools compiling Scala code; Modify...
Read more >News Suixi eWa - Shoeless Joe's
Working girl ending, Amnesty international torture test, Xi wang harvard, Ck 5814. ... Reasons to end up relationship, Charrito negr0 quererte fue un...
Read more >PreCompiler Session 01 Tuesday 08:00 - CodeMash
This handson session will set you on the path from being Miss Cleo to ... test environment to research and fix the bug...
Read more >Esa Jaaskela – Just another (coding) WordPress site
I couldn't yet find “Unit testing framework integration for dummies”, but once I find one I'll be sure to get one. FilterUnitTest. To...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I may have tracked down the root cause by running
bloop console PROJECT_NAME
This Bloop JSON file contains jars on the classpath, which don’t exist. This JSON file was created with an older version of the Pants exporter. I am unable to reproduce when using the latest version of the Pants exporter (which copies over jars and uses an immutable classpath).
I believe Bloop should still be able to gracefully handle this situation, maybe by reporting a warning under --verbose when the classpath contains non-existing entries.
Thanks for the follow-up and the reproduction, I’m happy we tracked this issue down!
Given that
System.setErr
could be triggered by classloading the test jars, I believe we should add some logic to bloop to reset back streams right after classloading is done. Nailgun needs the streams to be instances of their concrete thread-local stream classes so that it can redirect in, out and err directly to the socket streams of every client, even when several clients run at the same time.The implementation of the fix on the bloop side should account for the fact that test classloading can happen concurrently when parallel execution is enabled.