Skip to content

Commit

Permalink
Force tests to be sequential + Use a FixedThreadPool for avoiding locks
Browse files Browse the repository at this point in the history
+ IO are still blocking using Process() so we need more threads than the
default for some crasier tests.
  • Loading branch information
Gaëtan Renaudeau committed Mar 17, 2014
1 parent af5a53d commit 9b4c3cf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ object BuildSettings {
version := buildVersion,
scalaVersion := "2.10.0",
crossScalaVersions := Seq("2.10.0"),
crossVersion := CrossVersion.binary
crossVersion := CrossVersion.binary,
parallelExecution in Test := false,
testOptions in Test += Tests.Argument("sequential")
) ++ Publish.settings
}

Expand Down
7 changes: 5 additions & 2 deletions src/test/scala/tests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import playcli.CLI
import sys.process.Process
import play.api.libs.iteratee._
import org.specs2.mutable._
import java.util.concurrent.Executors
import concurrent.ExecutionContext
import ExecutionContext.Implicits.global
// import ExecutionContext.Implicits.global
import concurrent.{Promise, Future, Await}
import concurrent.duration.Duration
import collection.immutable.StringOps
Expand All @@ -14,6 +15,9 @@ import java.io.File


object Utils {

implicit val context = ExecutionContext.fromExecutor(Executors.newFixedThreadPool(64)).prepare()

val maxDuration = Duration("9 second")

val stringToBytes = (str: StringOps) => str.map(_.toByte).toArray
Expand All @@ -39,7 +43,6 @@ object Resources {
val bigEnum = Enumerator.apply(bigItems : _*)
}


class CLIenumerate extends Specification {
import Utils._
import Resources._
Expand Down

0 comments on commit 9b4c3cf

Please sign in to comment.