fork setting ignored when running tests

325 views
Skip to first unread message

Eugene Vigdorchik

unread,
Aug 15, 2011, 10:19:15 AM8/15/11
to simple-build-tool
Hi,
This must be a really stupid mistake on my side, but when I put the
following line in my build.sbt in 0.10,

fork in test := true

the 'fork' setting is ignored and the tests are still run in sbt jvm
itself.
I would appreciate any help on what might be wrong here.

Thanks,
Eugene.

Mark Harrah

unread,
Aug 15, 2011, 10:59:22 AM8/15/11
to simple-b...@googlegroups.com
Hi Eugene,

sbt doesn't support forking tests.

-Mark

> Thanks,
> Eugene.
>

Eugene Vigdorchik

unread,
Aug 15, 2011, 11:02:19 AM8/15/11
to simple-b...@googlegroups.com
Hi Mark,

I'm a bit lost now. How do I profile the test then?

Eugene.

>
> -Mark
>
>> Thanks,
>> Eugene.
>>
>
> --
> You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
> To post to this group, send email to simple-b...@googlegroups.com.
> To unsubscribe from this group, send email to simple-build-t...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/simple-build-tool?hl=en.
>
>

Jason Zaugg

unread,
Aug 15, 2011, 3:56:41 PM8/15/11
to simple-b...@googlegroups.com
On Monday, August 15, 2011 5:02:19 PM UTC+2, Eugene Vigdorchik wrote:
Hi Mark,

On Mon, Aug 15, 2011 at 6:59 PM, Mark Harrah <dmha...@gmail.com> wrote:
> Hi Eugene,
>
> On Mon, 15 Aug 2011 07:19:15 -0700 (PDT)
> Eugene Vigdorchik <eugene.v...@gmail.com> wrote:
>
>> Hi,
>> This must be a really stupid mistake on my side, but when I put the
>> following line in my build.sbt in 0.10,
>>
>> fork in test := true
>>
>> the 'fork' setting is ignored and the tests are still run in sbt jvm
>> itself.
>> I would appreciate any help on what might be wrong here.
>
> sbt doesn't support forking tests.
I'm a bit lost now. How do I profile the test then?

You can just add the necessary JVM options to SBT itself. Or you can call the code from a main method, which can be forked from SBT.

-jason

Eugene Vigdorchik

unread,
Aug 16, 2011, 3:41:48 PM8/16/11
to simple-b...@googlegroups.com
Yes, the former solved my practical needs. Still curious what's the
reason for not supporting fork in tests. Looks weird from the user
perspective...

Cheers,
Eugene.

>
> -jason


>
> --
> You received this message because you are subscribed to the Google Groups
> "simple-build-tool" group.

> To view this discussion on the web visit
> https://groups.google.com/d/msg/simple-build-tool/-/yQ-7DYp6JLkJ.

Mark Harrah

unread,
Aug 18, 2011, 10:56:22 PM8/18/11
to simple-b...@googlegroups.com
On Tue, 16 Aug 2011 23:41:48 +0400
Eugene Vigdorchik <eugene.v...@gmail.com> wrote:

> On Mon, Aug 15, 2011 at 11:56 PM, Jason Zaugg <jza...@gmail.com> wrote:
> > On Monday, August 15, 2011 5:02:19 PM UTC+2, Eugene Vigdorchik wrote:
> >>
> >> Hi Mark,
> >>
> >> On Mon, Aug 15, 2011 at 6:59 PM, Mark Harrah <dmha...@gmail.com> wrote:
> >> > Hi Eugene,
> >> >
> >> > On Mon, 15 Aug 2011 07:19:15 -0700 (PDT)
> >> > Eugene Vigdorchik <eugene.v...@gmail.com> wrote:
> >> >
> >> >> Hi,
> >> >> This must be a really stupid mistake on my side, but when I put the
> >> >> following line in my build.sbt in 0.10,
> >> >>
> >> >> fork in test := true
> >> >>
> >> >> the 'fork' setting is ignored and the tests are still run in sbt jvm
> >> >> itself.
> >> >> I would appreciate any help on what might be wrong here.
> >> >
> >> > sbt doesn't support forking tests.
> >> I'm a bit lost now. How do I profile the test then?
> >
> > You can just add the necessary JVM options to SBT itself. Or you can call
> > the code from a main method, which can be forked from SBT.
> Yes, the former solved my practical needs. Still curious what's the
> reason for not supporting fork in tests. Looks weird from the user
> perspective...

Someone has to implement it and it would probably be a fair amount of work to do it right.

-Mark

Brian Clapper

unread,
Aug 19, 2011, 11:53:49 AM8/19/11
to simple-b...@googlegroups.com
On 08/18/2011 10:56 PM, Mark Harrah wrote:

>>> You can just add the necessary JVM options to SBT itself. Or you can call
>>> the code from a main method, which can be forked from SBT.
>> Yes, the former solved my practical needs. Still curious what's the
>> reason for not supporting fork in tests. Looks weird from the user
>> perspective...
>
> Someone has to implement it and it would probably be a fair amount of work to do it right.

Is there an open issue for this? The fact that fork isn't supported for tests
explains how repeated runs of tests that allocate and destroy lots of objects
will eventually cause SBT to blow up with an "out of PermGen space" error.
--
-Brian

Brian Clapper, http://www.clapper.org/bmc/
Maintainer's Motto: If we can't fix it, it ain't broke.

Mark Harrah

unread,
Aug 21, 2011, 10:43:29 PM8/21/11
to simple-b...@googlegroups.com
On Fri, 19 Aug 2011 11:53:49 -0400
Brian Clapper <brian....@gmail.com> wrote:

> On 08/18/2011 10:56 PM, Mark Harrah wrote:
>
> >>> You can just add the necessary JVM options to SBT itself. Or you can call
> >>> the code from a main method, which can be forked from SBT.
> >> Yes, the former solved my practical needs. Still curious what's the
> >> reason for not supporting fork in tests. Looks weird from the user
> >> perspective...
> >
> > Someone has to implement it and it would probably be a fair amount of work to do it right.
>
> Is there an open issue for this?

No, the scope of this is likely a separate project.

> The fact that fork isn't supported for tests
> explains how repeated runs of tests that allocate and destroy lots of objects
> will eventually cause SBT to blow up with an "out of PermGen space" error.

This is unlikely. Just allocating objects in general will not affect PermGen.

-Mark

Reply all
Reply to author
Forward
0 new messages