I am working with some classes that (for some reason) can only be used once within a single VM. My test cases work if I run them individually (fork := true
) enabled in my sbt
settings.
If I run more than one of these tests, they fail with an exception that has to with a thread executor rejecting a task (it's most likely closed). It would be very time consuming to find out what causes the problem and even if I find the problem, I might not be able to resolve it (I do not have access to the source code).
I am currently using the specs2
test framework, but any test framework using sbt
would be acceptable.
Is there any test framework for sbt
that is capable of running each test in a jvm
fork?
Thoughts or ideas on possible other solutions are of course welcome.
Using non-deprecated syntax:
testGrouping in Test := (definedTests in Test).value map { test =>
Tests.Group(name = test.name, tests = Seq(test), runPolicy = Tests.SubProcess(
ForkOptions(
javaHome.value,
outputStrategy.value,
Nil,
Some(baseDirectory.value),
javaOptions.value,
connectInput.value,
envVars.value
)))
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With