Retry Analyzer does not work for @Factory Tests

263 views
Skip to first unread message

Pranav

unread,
Jul 28, 2010, 2:32:55 PM7/28/10
to testng...@googlegroups.com
List / Cédric,

Did anybody used Retry Analyzer with @Factory ?  I am observing a very strange behaviour while using that. So  say I have a factory which creates 10 instances ( Test #0-#9) of my test class ( each testclass has just one Retry-Analyzer enabled @Test method  ), and say Test#5  is gonna fail, now I expect Test#5 to be retried n number of time, but what happens is instead of Test#5, Test#0 gets retried, and as its passing it marks Test#5 passed.  it always retries the first test irrelevant of what test failed.

I am attaching my sample classes with this email, just in case you guys want to see the issue yourself.

I tried the same thing with DataProviders, retries works over there perfectly fine.

Anybody knows some trick to get around this issue ? Should I file a bug for this ?

Best,
Pranav

P.S : I am on TestNG 5.12.1 , and I did try the same code with 5.8 too but same results.
MyFactory.java
FactoryTest.java
MyRetry.java

Cédric Beust ♔

unread,
Jul 28, 2010, 2:37:56 PM7/28/10
to testng...@googlegroups.com
Hi Pranav,

This looks like a bug, I'll take a look.

--
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.



--
Cédric


Pranav

unread,
Jul 29, 2010, 4:01:42 PM7/29/10
to testng...@googlegroups.com
Thanks for looking into this Cédric,  no rush.... but do you have some rough idea about how long it will take you to fix it, if its gonna take time, I will migrate my current project to use DataProviders instead of Factory.

Also if  you think Its something which I can  fix myself in TestNG codebase, please pass me some pointers, and i will be more than happy to work on this.

Best,
Pranav

Pranav

unread,
Aug 5, 2010, 7:05:53 PM8/5/10
to testng...@googlegroups.com
Hi Cédric,

Just wanted to check if you had any updates on this issue ?

Best,
Pranav

Cédric Beust ♔

unread,
Aug 5, 2010, 7:38:23 PM8/5/10
to testng...@googlegroups.com
Sorry Pranav, not yet, but now that 5.13 is out, I'm hoping to get back to this issue soon.

--
Cédric

Cédric Beust ♔

unread,
Aug 6, 2010, 12:13:11 AM8/6/10
to testng...@googlegroups.com, Pranav
Pranav,

I think I fixed the problem, can you verify?  http://testng.org/beta

--
Cédric


On Wed, Jul 28, 2010 at 11:32 AM, Pranav <pranav...@gmail.com> wrote:
--
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.



--
Cédric


Pranav

unread,
Aug 6, 2010, 1:56:38 AM8/6/10
to Cédric Beust ♔, testng...@googlegroups.com
Cédric,

Thanks a lot , for looking into this, but this still does not work, I have modified my classes little bit to explain this bug better, please find the attached classes with this mail. once you run it with your beta jar ( or testng 5.12.1/5.13.1) you will see something like this :

Test Called : Test0
Test Called : Test1
fail
Test Called : Test0
PASSED: Test0
PASSED: Test0

As you can see after Test1 fail, Test 0 gets called instead of Test1.

Best,
Pranav
FactoryTest.java
MyFactory.java
MyRetry.java

Mrunal Gosar

unread,
Feb 27, 2015, 1:49:29 AM2/27/15
to testng...@googlegroups.com, ced...@beust.com
Did we get a fix for this?

Krishnan Mahadevan

unread,
Feb 27, 2015, 3:11:06 AM2/27/15
to testng...@googlegroups.com
Why not give this a try yourself with the latest TestNG version and check if the fix is there ?

I believe that the earlier posts in this thread did have some tests which could be used to recreate the problem no ?

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

On Fri, Feb 27, 2015 at 12:19 PM, Mrunal Gosar <predator.t...@gmail.com> wrote:
Did we get a fix for this?

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.

To post to this group, send email to testng...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages