Classloader oddities with specs2 3.8.7+ and sbt

20 views
Skip to first unread message

Antonio Salazar Cardozo

unread,
Mar 13, 2017, 4:54:49 PM3/13/17
to sbt-dev
Hey there folks,
I've run into some oddities with classloaders and specs2 3.8.7+. Because
the classloader is seemingly managed by sbt, I'm posting here to see if anyone
can figure out what's going on.

I've put up a sample project demonstrating the issue at hand on Github at
Shadowfiend/specs2-concurrent-boom-boom. As observed, the problem is that
if I run `all project1/test project2/test`, project2 can end up using a classloader
that is a ClasspathFilter referencing project1 instead of project2, or vice versa.
In some cases, project 1's worker will reference project 2's ClasspathFilter and
project 2's worker will reference project 1's ClasspathFilter, all at the same time.

I inserted some breakpoints in a few places and saw that only one ForkJoinPool
is actually generated for specs2, even when running `all project1/test project2/test`,
even with fork := true. Not 100% sure if all threads in that pool will in turn end
up with the same classloader parent or what, but it seems like it could be the
source of the issue?

I'm a bit out of my depth here, but would appreciate any insight as to the
expected interactions between classloaders in sbt and test frameworks spawned
by sbt.
Thanks,
Antonio

eugene yokota

unread,
Mar 13, 2017, 4:59:05 PM3/13/17
to sbt...@googlegroups.com
Hi,

sbt-dev list is for discussing contribution to sbt and/or its plugins.
Normally I'd send you to [this page](http://www.scala-sbt.org/community.html#how-can-I-get-help),
but since there's been some discussions around class loaders recently among the contributors,
so I figured it might be interesting to discuss here:

-eugene


--
You received this message because you are subscribed to the Google Groups "sbt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sbt-dev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sbt-dev/0d5bf0ec-1110-4a14-96ff-9df529d7e17e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Antonio Salazar Cardozo

unread,
Mar 13, 2017, 5:32:07 PM3/13/17
to sbt-dev
Apologies, it looked like this was maybe deep enough to warrant this list, but I see
that it's only for confirmed bugs and this is definitely not confirmed to be a bug. I'll
go have a look there and/or head to Stack Overflow; thanks!
Antonio
To unsubscribe from this group and stop receiving emails from it, send an email to sbt-dev+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages