concurrency/executor issue when testing

23 views
Skip to first unread message

maarten

unread,
Mar 5, 2013, 4:21:55 PM3/5/13
to simple-b...@googlegroups.com
Hi,

I have a pretty severe bug with sbt when I try to run a test (specs2, akka testkit). The test case starts an akka actor, that in turn creates a Future.

Whenever a future is created, I err out with a stack trace containing:
at sbt.Execute.work(Execute.scala:238)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:232)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:232)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)

etc. It looks to me as if the Future can't be created due to sbt concurrency restrictions, but I am *clueless* as on how to lift them.

Any suggestions or ideas are greatly appreciated!

Thanks,
Maarten

maarten

unread,
Mar 5, 2013, 6:23:27 PM3/5/13
to simple-b...@googlegroups.com
Different issue - it turns out that any exception turns into this. Makes it hard to debug, what can I do to improve this?

--Maarten

Op dinsdag 5 maart 2013 22:21:55 UTC+1 schreef maarten het volgende:

maarten

unread,
Mar 5, 2013, 6:28:13 PM3/5/13
to simple-b...@googlegroups.com
Looked at the test case again - there is a concurrency limitation that's biting me as well. Any easy way to tune that "up" for a (sub-project?

Op woensdag 6 maart 2013 00:23:27 UTC+1 schreef maarten het volgende:

Robin Green

unread,
Mar 6, 2013, 4:10:55 AM3/6/13
to simple-b...@googlegroups.com
Since you've only quoted part of the stack trace, it's hard to debug this issue. However, I do remember that specs2 doesn't print (full) stack traces by default, but that's configurable.

etorreborre

unread,
Mar 6, 2013, 9:02:11 AM3/6/13
to simple-b...@googlegroups.com
If you want to read the full stacktrace you can execute:

sbt>test-only *MyAkkaSpec* -- fullstacktrace

Also don't forget that by default sbt and specs2 run things in parallel. To deactivate that:

 - for sbt, in build.sbt: parallelExecution := false
 - for specs2, inside your spec: class MySpec extends Specification { sequential; ... } 
 - for specs2, in sbt command-line: sbt>test-only *MyAkkaSpec* -- sequential

Cheers,

Eric.

maarten

unread,
Mar 7, 2013, 4:09:36 AM3/7/13
to simple-b...@googlegroups.com
The combination of all three gave better stack traces and allowed me to debug, thanks a *lot*

--Maarten

Op woensdag 6 maart 2013 15:02:11 UTC+1 schreef etorreborre het volgende:
Reply all
Reply to author
Forward
0 new messages