Re: Factories and multithread

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Factories and multithread

Cédric Beust ♔
[CC'ing testng-dev]

I'm investigating an approach right now.  The problem is that the method worker is created per test method, and then the invocation is done inside this worker on each instance (all of which are retrieved from the method), explaining why they're all in the same thread.

I don't want to change that part, so I'm going to dissociate the instances and the methods, so that instead of doing

new Worker(ITestNGMethod):
  for all instances of the method, invoke the test

We will do

new Worker(ITestNGMethod, Object instance)
  invoke the method on this instance

So that potentially, we'll have

Worker(f1(), o1)
Worker(f1(), o2)

This should fit in nicely with the existing thread architecture.

What do you think?

--
Cedric


On 12/20/06, Alexandru Popescu <[hidden email]> wrote:
I think I did it in the past, but I cannot remember the details right
now. Can you share the source of this request? Also, please let me
know if you want me to look into it (I am working now on the source
code).

./alex
--
.w( the_mindstorm )p.


On 12/20/06, C�dric Beust < [hidden email]> wrote:
> Hey Alex,
>
> I have a request asking us to make it possible for tests returned from
> factories to be run in different threads.  Looking into it right now, but
> thought I'd ask you if you have thought about it before...?
>
> --
> C�dric



--
C�dric
--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups "testng-dev" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/testng-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Factories and multithread

Alexandru Popescu ☀
At first glance it sounds good. I will check the code when committed.

./alex
--
.w( the_mindstorm )p.


On 12/20/06, C�dric Beust   <[hidden email]> wrote:

> [CC'ing testng-dev]
>
> I'm investigating an approach right now.  The problem is that the method
> worker is created per test method, and then the invocation is done inside
> this worker on each instance (all of which are retrieved from the method),
> explaining why they're all in the same thread.
>
> I don't want to change that part, so I'm going to dissociate the instances
> and the methods, so that instead of doing
>
> new Worker(ITestNGMethod):
>   for all instances of the method, invoke the test
>
> We will do
>
> new Worker(ITestNGMethod, Object instance)
>   invoke the method on this instance
>
> So that potentially, we'll have
>
> Worker(f1(), o1)
> Worker(f1(), o2)
>
> This should fit in nicely with the existing thread architecture.
>
> What do you think?
>
> --
> Cedric
>
>
>
> On 12/20/06, Alexandru Popescu
> <[hidden email] > wrote:
> > I think I did it in the past, but I cannot remember the details right
> > now. Can you share the source of this request? Also, please let me
> > know if you want me to look into it (I am working now on the source
> > code).
> >
> > ./alex
> > --
> > .w( the_mindstorm )p.
> >
> >
> > On 12/20/06, C�dric Beust   < [hidden email]> wrote:
> > > Hey Alex,
> > >
> > > I have a request asking us to make it possible for tests returned from
> > > factories to be run in different threads.  Looking into it right now,
> but
> > > thought I'd ask you if you have thought about it before...?
> > >
> > > --
> > > C�dric
> >
>
>
>
> --
> C�dric

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups "testng-dev" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/testng-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Factories and multithread

Cédric Beust ♔
Done, I just submitted it.  Was easier than I thought.

It only works for parallel="methods", though ("tests" only makes sense when you are using a testng.xml file).

Still need to write tests and verify that the thread pool size is honored.

--
Cedric



On 12/20/06, Alexandru Popescu <[hidden email]> wrote:
At first glance it sounds good. I will check the code when committed.

./alex
--
.w( the_mindstorm )p.


On 12/20/06, C dric Beust   <[hidden email]> wrote:

> [CC'ing testng-dev]
>
> I'm investigating an approach right now.  The problem is that the method
> worker is created per test method, and then the invocation is done inside
> this worker on each instance (all of which are retrieved from the method),
> explaining why they're all in the same thread.
>
> I don't want to change that part, so I'm going to dissociate the instances
> and the methods, so that instead of doing
>
> new Worker(ITestNGMethod):
>   for all instances of the method, invoke the test
>
> We will do
>
> new Worker(ITestNGMethod, Object instance)
>   invoke the method on this instance
>
> So that potentially, we'll have
>
> Worker(f1(), o1)
> Worker(f1(), o2)
>
> This should fit in nicely with the existing thread architecture.
>
> What do you think?
>
> --
> Cedric
>
>
>
> On 12/20/06, Alexandru Popescu
> < [hidden email] > wrote:
> > I think I did it in the past, but I cannot remember the details right
> > now. Can you share the source of this request? Also, please let me
> > know if you want me to look into it (I am working now on the source
> > code).
> >
> > ./alex
> > --
> > .w( the_mindstorm )p.
> >
> >
> > On 12/20/06, C dric Beust   < [hidden email]> wrote:
> > > Hey Alex,
> > >
> > > I have a request asking us to make it possible for tests returned from
> > > factories to be run in different threads.  Looking into it right now,
> but
> > > thought I'd ask you if you have thought about it before...?
> > >
> > > --
> > > C dric
> >
>
>
>
> --
> C dric

C dric
--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups "testng-dev" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/testng-dev?hl=en
-~----------~----~----~----~------~----~------~--~---