Today, I encountered an issue while running tests for one of my Scala SBT projects. Each time, ran sbt test command hang. After running jvisualvm, I discovered that it is due to thread deadlock. I couldn’t figure out why deadlock is happening. Test cases worked fine when ran individually. To work through this issue, I disabled parallel execution of tests.
From command-line, you can use following command to disable parallel execution of test:
$ sbt 'set parallelExecution in Test := false' test
You can also set this setting in your build.sbt to avoid setting this setting manually.In your build.sbt , add the following line.
parallelExecution := false
I got the same issue, but don’t like the idea of changing to sequential execution. I add an issue to sbt, hopefully, someone could help – https://github.com/sbt/sbt/issues/3022. If you find anything, please let me know. Thanks.
I got the same issue, but don’t like the idea of changing to sequential execution. I add an issue to sbt, hopefully, someone could help – https://github.com/sbt/sbt/issues/3022. If you find anything, please let me know. Thanks.