My RetryAnalyzer retries forever (since 6.8.15)

159 views
Skip to first unread message

JackC

unread,
Feb 9, 2015, 4:17:57 AM2/9/15
to testng...@googlegroups.com
Unfortunately i haven't had time to investigate thoroughly but my simple IRetryAnalyzer implementation now retries forever from this version to current (6.8.14 works fine). I suspect it might have something to do with https://github.com/cbeust/testng/pull/572. I tried to look through the code but its a little cryptic to fresh eyes.

I haven't spotted any other comments of anyone else seeing this so i thought i would post here to see if this is common knowledge.

Cheers

My basic retry analyzer:

public class RetryAnalyzer implements IRetryAnalyzer {
    private int retryCount = 0;
    private int maxRetryCount;
    private static int maxRetryCountInitializer = 2;

    public static void setMaxRetryCountInitializer(int maxRetryCount) {
        RetryAnalyzer.maxRetryCountInitializer = maxRetryCount;
    }

    public RetryAnalyzer() {
        this.retryCount = 0;
        this.maxRetryCount = maxRetryCountInitializer;
    }

    @Override
    public boolean retry(ITestResult result) {
        if (hasRetriesRemaining()) {
            retryCount++;
            return true;
        }

        return false;
    }

    private boolean hasRetriesRemaining() {
        return (retryCount < this.maxRetryCount);
    }
}

Jorge Enrique Pombar

unread,
Feb 12, 2015, 2:23:17 AM2/12/15
to testng...@googlegroups.com
I ran into the same problem. In my experiments it works if you set the maxRetry count to 1, in that case it retries only once as expected. If you set it to 2 or more then it goes into that loop where it retries forever

Krishnan Mahadevan

unread,
Feb 13, 2015, 9:22:39 AM2/13/15
to testng...@googlegroups.com, Cedric Beust
I have attempted at fixing this problem.

The pull request for the same : https://github.com/cbeust/testng/pull/606

Cedric,
Can you please help get this merged ? I have run the build and I have all the tests passing.




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/

--
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.
Visit this group at http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.

Cédric Beust ♔

unread,
Feb 13, 2015, 12:47:44 PM2/13/15
to Krishnan Mahadevan, testng...@googlegroups.com
Done. Do you mind adding a line to the CHANGES file to describe this change?

Thanks!


-- 
Cédric

Vitor Machado

unread,
Mar 4, 2015, 12:34:40 PM3/4/15
to testng...@googlegroups.com
Still happening to me as of 6.8.21. Reverting to 6.8.14 fixed the problem.

Krishnan Mahadevan

unread,
Mar 7, 2015, 12:18:20 AM3/7/15
to testng...@googlegroups.com
Vitor,
Do you have a sample test that you would like to share with us, which I can use to recreate the problem in TestNG 6.8.21 ?

Thanks & Regards
Krishnan Mahadevan

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

--

Vitor Machado

unread,
Mar 11, 2015, 11:46:52 AM3/11/15
to testng...@googlegroups.com
Here's a simple eclipse project (with an Ant buildfile included) to run the bug scenario.
TestProj.zip
Message has been deleted
Message has been deleted

Dinesh Srinivasan

unread,
Mar 12, 2015, 4:41:24 AM3/12/15
to testng...@googlegroups.com
The test attached runs 3 times for me ( retries for 2 times ). 

Krishnan Mahadevan

unread,
Mar 12, 2015, 5:45:24 AM3/12/15
to testng...@googlegroups.com
Vitor,

I am able to recreate the problem using your sample. So I decided to do some research around this.

When I looked at the commit history : https://github.com/cbeust/testng/commits/master

I noticed that the fix that I put in was merged after 6.8.21 was released.

This is the commit history for 6.8.21 tag : https://github.com/cbeust/testng/commits/testng-6.8.21 

So I guess you would need to wait till the next version of TestNG comes out for you to avail the fix.


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/

Vitor Machado

unread,
Mar 12, 2015, 8:16:35 AM3/12/15
to testng...@googlegroups.com
I see, thank you!

Ajith V L

unread,
Mar 25, 2015, 10:29:32 AM3/25/15
to testng...@googlegroups.com
Does anyone know when the next version would come out? I am using this feature and i cant switch to previous version because i am seeing a null pointer exception there.
Reply all
Reply to author
Forward
0 new messages