Here is what was discussed...
------------------------------------------------------------------------------------------------------
Yeah, it would be nice for more fine grained thread control.
Right now, the threads and invocation don't really have a 1 to 1
mapping, so although there are three threads, there is no guarantee
that say 2 invocations will run in the same thread, etc... It would be
nice to add such a feature.
@Test(threadPoolSize = 3, invocationCount = 6, threadMap =
{2, 2, 2})
Basically stating that each thread has 2 invocations each. I'm sure
there is a cleaner, friendlier way of doing this, with maybe more
flexibility, but in general, we need to control thread/invocation
combos.
Ilya
------------------------------------------------------------------------------------------------------
I added a few functionalities recently to enable some of this. For
example, you can specify that all the test methods inside a class
should be run in the same thread, even if the current suite is being
run in parallel (@Test(sequential = true)).
This was necessary for users who want to run their tests multithreaded
for the speed gain, but who sometimes have to test methods that are not
multithread-safe. Now, they can simply put these methods in a class
that has the above attribute and TestNG will run them in the same
thread.
As for your request and the threadMap, let me think about that (and
let's take the discussion to the testng-users mailing-list).
--
Cedric
lya the idea sounds interesting, but I would definitely like to hear
more from you about the scenario you are trying to achieve. Lately, I
have done lots of tests based on TestNG parallel mode (both for
concurrency issues and also to simulate load testing), but never felt
the need to know what threads are involved as long as I was sure they
are used :-).
./alex
--
.w( the_mindstorm )p.
TestNG co-founder
EclipseTestNG Creator
Ilya, I must confess that I had read your message a couple of times
before posting the following comments, so please bare with me.
- in most of the cases I have used this feature, I wasn't interested
in the allocation of the threads and their dependencies; I was rather
testing the behavior under concurrent access
- in case I would need to be aware of the way threads are allocated I
would most probably use more complex test scenarios using parallelism
on multiple methods, groups and before/after mechanisms
Also, after reading your message I have got the impression that you
would like to have this advanced feature inside TestNG to cover a very
specific test you need to write (and for which there may be other
approaches available).
Hope I haven't completely misunderstood your scenario,