You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Kristian Rosenvold <kr...@gmail.com> on 2015/07/25 12:23:00 UTC

Interleaving forks/tests

I've been thinking about the way surefire forks JVMs for all the
scenarios where it forks a new JVM per testcase; right now we
basically start one JVM, load the surefire provider and run the test.
Then we shut down the JVM. Repeat until done.

Since we have a 2-way comms channel between the main plugin and the
fork, I'm thinking we could start N extra JVM's, load surefire
providers, wait for "go" signal from main process (and always keep N
fresh JVMs waiting), run the test and then shutdown. Starting a JVM
costs approximately 100ms, and in this manner we could avoid incurring
a 100ms penalty for every test run.

I'm thinking maybe N could be the CPU core count. In this manner we'd
have number of "started" JVMs that have not yet started loading user
code, but are ready to do so at the moment they receive "go". This
should avoid any resource conflicts, since no user code has yet been
run.

We'd certainly be using a little more resources, but it should be
nothing out of the ordinary?

WDYT ? Am I missing something ?

Kristian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Interleaving forks/tests

Posted by Tibor Digana <ti...@apache.org>.
We have reusable forks which may help some users already if configuring
with <reuseForks>true</reuseForks>.
Does this have the same effect you want to reach?

Your idea is about forks per module or per build?

Because if it is per build, this may speed up the parallel builds which
have really fast unit test << 100 ms.
Reusable forks across modules would be great to have. I bet this would work
only with new ClassLoader in each run, leaving the std in/out mechanism we
have right now. In such case user must rely on shared system/env
properties/vars or we will add functionality to override them but I am not
sure if all Java system properties can be overridden after process startup.

On Sat, Jul 25, 2015 at 12:24 PM, Kristian Rosenvold-4 [via Maven] <
ml-node+s40175n5840888h68@n5.nabble.com> wrote:

> I've been thinking about the way surefire forks JVMs for all the
> scenarios where it forks a new JVM per testcase; right now we
> basically start one JVM, load the surefire provider and run the test.
> Then we shut down the JVM. Repeat until done.
>
> Since we have a 2-way comms channel between the main plugin and the
> fork, I'm thinking we could start N extra JVM's, load surefire
> providers, wait for "go" signal from main process (and always keep N
> fresh JVMs waiting), run the test and then shutdown. Starting a JVM
> costs approximately 100ms, and in this manner we could avoid incurring
> a 100ms penalty for every test run.
>
> I'm thinking maybe N could be the CPU core count. In this manner we'd
> have number of "started" JVMs that have not yet started loading user
> code, but are ready to do so at the moment they receive "go". This
> should avoid any resource conflicts, since no user code has yet been
> run.
>
> We'd certainly be using a little more resources, but it should be
> nothing out of the ordinary?
>
> WDYT ? Am I missing something ?
>
> Kristian
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5840888&i=0>
> For additional commands, e-mail: [hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5840888&i=1>
>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
> http://maven.40175.n5.nabble.com/Interleaving-forks-tests-tp5840888.html
>  To start a new topic under Maven Developers, email
> ml-node+s40175n142166h86@n5.nabble.com
> To unsubscribe from Maven Developers, click here
> <http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=142166&code=dGlib3JkaWdhbmFAYXBhY2hlLm9yZ3wxNDIxNjZ8LTI4OTQ5MjEwMg==>
> .
> NAML
> <http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://maven.40175.n5.nabble.com/Interleaving-forks-tests-tp5840888p5840899.html
Sent from the Maven Developers mailing list archive at Nabble.com.