Skip to content

Commit

Permalink
Make Travis happy
Browse files Browse the repository at this point in the history
  • Loading branch information
Alejandro Gómez committed Jan 5, 2017
1 parent 19b5365 commit 92d9c7e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
3 changes: 2 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ lazy val fetch = crossProject
.settings(moduleName := "fetch")
.settings(allSettings: _*)
.jsSettings(
jsEnv := NodeJSEnv(args=Seq("--max_old_space_size=2048", "--stack_size=2048")).value.withSourceMap(false)
jsEnv := NodeJSEnv(args = Seq("--max_old_space_size=4096", "--stack_size=4096")).value
.withSourceMap(false)
)
.enablePlugins(AutomateHeaderPlugin)

Expand Down
17 changes: 12 additions & 5 deletions shared/src/test/scala/FetchTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -954,13 +954,20 @@ class FetchBatchingTests extends AsyncFreeSpec with Matchers {
}

"Very deep fetches don't overflow stack or heap" in {
val depth = 2000
val fetch: Fetch[List[Int]] = Fetch.traverse((1 to depth).toList)(fetchBatchedData)
import cats.syntax.traverse._

val depth = 20
val fetch: Fetch[List[Int]] = (1 to depth).toList
.map((x) => (0 until 2).toList.traverse(fetchBatchedData))
.foldLeft(
Fetch.pure(List.empty[Int])
)((acc, f) => acc.flatMap((x) => f))

Fetch.runFetch[Future](fetch).map {
case (env, res) =>
res shouldEqual (1 to depth).toList
totalFetched(env.rounds) shouldEqual depth
env.rounds.size shouldEqual depth / 2
res shouldEqual List(0, 1)
totalFetched(env.rounds) shouldEqual 2
env.rounds.size shouldEqual 1
}
}
}

0 comments on commit 92d9c7e

Please sign in to comment.