"No free nodes found in:[DynamicGraph" and group-by-instances="true"

1,874 views
Skip to first unread message

Ryszard

unread,
Apr 20, 2012, 1:47:04 PM4/20/12
to testng-users
I designed my tests to run using group-by-instances="true". It should
run test class after test class, method order as requested inside each
class using dependsOnMethods.

My tests run properly under Eclipse, with testng 5.14.6 and under
maven with the same version of testng.

When run under maven with testng 6.5.1 or 6.3.1 I get the following
exception:
org.apache.maven.surefire.util.SurefireReflectionException:
java.lang.reflect.InvocationTargetException; nested exception is
java.lang.reflect.InvocationTargetException: null
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:
189)
at org.apache.maven.surefire.booter.ProviderFactory
$ProviderProxy.invoke(ProviderFactory.java:165)
at
org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:
85)
at
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:
103)
at
org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:
74)
Caused by: org.testng.TestNGException:
No free nodes found in:[DynamicGraph


When I change setting to run group-by-instances="false", then there is
no error and my tests run but of course they were not desinged to run
in this order.

Where to look to find a problem?
What it means "No free nodes found in:[DynamicGraph "?

Any help will be appreciated.


Cédric Beust ♔

unread,
Apr 20, 2012, 1:55:55 PM4/20/12
to testng...@googlegroups.com
Hi,

The real error message should be that TestNG found a cycle in your graph dependency, I wonder if Surefire is not swallowing some part of that error message.

Can you run your tests just from the command line (no maven, ant, etc...) to make sure?

-- 
Cédric






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


Ryszard Brykajlo

unread,
Apr 20, 2012, 7:30:51 PM4/20/12
to testng...@googlegroups.com
Cedric,

I have ran it from command line. The error message is the same.

I am attaching a zip file with my 3 classess, testng.xml and copy of console output. I hope it will help.

Thanks a lot for your prompt response.

cheers,

Ryszard




2012/4/20 Cédric Beust ♔ <ced...@beust.com>



--
From Super Natural British Columbia
Ryszard Brykajlo
home: 604.294.9159
   cell: 604.764.9318
Java and web development with Drupal, Joomla, Wordpress.

temp.zip

Ryszard

unread,
Apr 27, 2012, 8:13:43 PM4/27/12
to testng-users
Hi Cedric,

I am wondering if you have time to look to my problem or maybe tried
to run test code I emailed to you?

Is there something wrong in my code or there is in fact a bug in
testNG related to using group-by-instances="true"?

It seems to me that I found way around of my problem. I have to assign
each class to a different group and without using dependencies on
groups, my methods run the way I am expecting.

Best regards,

Ryszard



On Apr 20, 4:30 pm, Ryszard Brykajlo <ryszard.bryka...@gmail.com>
wrote:
> Cedric,
>
> I have ran it from command line. The error message is the same.
>
> I am attaching a zip file with my 3 classess, testng.xml and copy of
> console output. I hope it will help.
>
> Thanks a lot for your prompt response.
>
> cheers,
>
> Ryszard
>
> 2012/4/20 Cédric Beust ♔ <ced...@beust.com>
>
>
>
>
>
>
>
>
>
> > Hi,
>
> > The real error message should be that TestNG found a cycle in your graph
> > dependency, I wonder if Surefire is not swallowing some part of that error
> > message.
>
> > Can you run your tests just from the command line (no maven, ant, etc...)
> > to make sure?
>
> > --
> > Cédric
>
> *Ryszard Brykajlo*
> home: 604.294.9159
>    cell: 604.764.9318
> Java and web development with Drupal <http://drupal.org/>,
> Joomla<http://www.joomla.org/>,
> Wordpress <http://wordpress.org/>.
>
>  temp.zip
> 3KViewDownload

hop...@gmail.com

unread,
Jun 3, 2013, 9:39:26 AM6/3/13
to testng...@googlegroups.com
Hello!
 
I faced a similar issue. I'm using Eclipse Juno and TestNG plugin 6.8.6. I got:
 
org.testng.TestNGException:
No free nodes found in:[DynamicGraph
  Ready:[BaseTest.test1()[pri:0, instance:test.MyTest1@76fba0], BaseTest.test1()[pri:0, instance:test.MyTest2@170bea5], BaseTest.test2()[pri:0, instance:test.MyTest1@76fba0], BaseTest.test2()[pri:0, instance:test.MyTest2@170bea5]]
  Running:[]
  Finished:[]
  Edges:
     BaseTest.test1()[pri:0, instance:test.MyTest2@170bea5]
        BaseTest.test2()[pri:0, instance:test.MyTest2@170bea5]
        BaseTest.test1()[pri:0, instance:test.MyTest1@76fba0]
        BaseTest.test2()[pri:0, instance:test.MyTest1@76fba0]
     BaseTest.test1()[pri:0, instance:test.MyTest1@76fba0]
        BaseTest.test2()[pri:0, instance:test.MyTest1@76fba0]
        BaseTest.test1()[pri:0, instance:test.MyTest2@170bea5]
        BaseTest.test2()[pri:0, instance:test.MyTest2@170bea5]
     BaseTest.test2()[pri:0, instance:test.MyTest1@76fba0]
        BaseTest.test1()[pri:0, instance:test.MyTest2@170bea5]
        BaseTest.test2()[pri:0, instance:test.MyTest2@170bea5]
     BaseTest.test2()[pri:0, instance:test.MyTest2@170bea5]
        BaseTest.test1()[pri:0, instance:test.MyTest1@76fba0]
        BaseTest.test2()[pri:0, instance:test.MyTest1@76fba0]
]
 
1) group-by-instances="true"
2) Several classes in one <test> that extend common BaseTest
3) IMethodInterceptor is added as Listener to the suite - it doesn't reorder, it simply returns the same List of methods as was given in parameter.
4) If method interceptor is removed then any order succeds.  If method interceptor is added then only the specific order succeeds.
 
Please see the attachd files for the detailed info.
 
Thank you.
 
stackTrace.txt
sources.txt

hop...@gmail.com

unread,
Jun 3, 2013, 9:53:11 AM6/3/13
to testng...@googlegroups.com
Test methods from my examply are dependant. So the second questin rises: why IMethodInterceptor accept such methods? It shouldn't according to the IMethodInterceptor documentation: "Only methods that have no dependents and that don't depend on any other test methods will be passed in parameter."
If I use debugger I see that a List of all test methods is passed to intercept() method, event dependent.
 
Is this a bug or documentation should be updated?

Abhishta Kumar

unread,
Sep 2, 2013, 11:59:02 PM9/2/13
to testng...@googlegroups.com

This kind of error message are very general, TestNG throws this message for multiple reasons. Check if you are loading the same class more than once, in  your TestNG.
For example:
           <Class name=class1 />
            <Class name=class2 />
            <class name=class1 />

          

Jinghong Cox Chen

unread,
Sep 3, 2013, 3:06:32 AM9/3/13
to testng...@googlegroups.com
Hi,

I have similar issue here. But, in my case, the execution is not deterministic.
Sometimes it runs, sometimes it doesn't.

My test suite xml is simple that should not have issue like Abhishta mentioned.

<test name="New Tests using TestNG" junit="false" group-by-instances="true">
<packages>
<package name="my.tests.*" />
</packages>
<groups>
<run>
<exclude name="to-be-fixed" />
</run>
</groups>
</test>


And, even when it runs, some tests are omitted randomly, which makes me frustrated.
Is this a known issue?

(I actually have two parts of test cases, one in JUnit, the other in TestNG as shown above. The JUnit part is very stable.)

Thanks,
- Cox

Abhishta Kumar於 2013年9月3日星期二UTC+8上午11時59分02秒寫道:

Greg Temchenko

unread,
Jun 10, 2014, 2:09:40 AM6/10/14
to testng...@googlegroups.com
The same bug, when I enabled group-by-instances="true" it's non-deterministic, 50% of times it runs fine, the other 50 it fails to run anything. Really not cool.

Hubert Grzeskowiak

unread,
Nov 18, 2014, 11:45:23 AM11/18/14
to testng...@googlegroups.com
Just strumbled upon the same bug.

My workaround is putting my classes in separate <test> elements in the suite. This seems to solve it.

Cheers
Hubert Grzeskowiak

Ken

unread,
Nov 18, 2014, 2:57:10 PM11/18/14
to testng...@googlegroups.com
I filed a bug on group dependencies and group by instances that was recently fixed.  Might be relevant:

Reply all
Reply to author
Forward
0 new messages