-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
onTestFailure not being called when test is retried (6.9.6) #857
Comments
If the behavior was different before, it is a bug. |
It certainly was. I have code to take screenshot and add that using reporter.log in testng results. Now, none of that is working :-( |
Ok, thank. I will have a look asap. |
@jineshkenandy I tried to reproduce your issue without success. See #860 and tell me if you see something bad. |
@juherr Could you put a print statement inside your onTestFailure method? Count has never been the issue it counts correctly for some reason. Another thing I observed is that you are calling testng from code and not xml. All of us who faced the issue are calling it from XML. Thanks, |
No need to print: the method is called and stored. +1 about xml, I will try. It should not change anything but I've already seen xml only problems. |
@juherr
|
It is really an uncommon way the initialize it? Can I ask why do you do it? BTW, about the print, can we suppose it is a display issue?
I don't understand what you want to say. |
@jineshkenandy I updated the sample with what I understood of your comments, but I confirm the result is still the same for me:
|
I am initializing my Retry Analyzer the same way as @jineshkenandy I am seeing the same thing. In a previous version of TestNG I handled the retries in the onTestFailed() method but when I updated to version 6.9.6 I noticed that wasn't getting called anymore. I have since had to add code to the onTestSkipped() and the onTestFailedButWithinSuccessPercentage() to handle my retries. It's working fine now but I was surprised by the change. |
It does seem to be fixed in 6.9.9. I created a very simple project to test it out that does 2 retries. This is what I am seeing in 6.9.6: This is what I am seeing in 6.9.9: I will upgrade to 6.9.9. Thanks! --Steve BTW, I looked at the change log for TestNG and there is nothing in there for the releases > 6.9.6 that mentions a fix for retried tests: https://github.com/cbeust/testng/blob/master/CHANGES.txt Am I looking in the wrong spot? |
@juherr Same result with 6.9.9 as well and I moved to annotation transformer. |
@szaluk Could you confirm that 6.9.9 is working fine for you on actual project and not test project? |
Sure. I will be able to try that tomorrow. I will let you know what I see. Thanks, |
@jineshkenandy - It does indeed seem to be working for me with 6.9.9 in my main project. This is how I am setting up my retry anaylzer:
This is how you were originally doing it before you changed over to annotation transformer. |
@szaluk Are you using testng to run selenium webdriver? |
@jineshkenandy - Yes. It's a Maven based project using Java 7 and Selenium WebDriver 2.48.2 |
@szaluk I am using Selenium WebDriver 2.48.2 with testNg, no luck whatsoever. |
Guys, should we understand the issue is fixed with 6.9.9? |
@juherr Please mark it as closed. Thanks for all the help. |
Hi, I can reproduce it in 6.9.9 as well. Best regards, Baubak From: Steven Zaluk <[email protected]mailto:[email protected]> It does seem to be fixed in 6.9.9. I created a very simple project to test it out that does 2 retries. This is what I am seeing in 6.9.6: This is what I am seeing in 6.9.9: I will upgrade to 6.9.9. Thanks! --Steve BTW, I looked at the change log for TestNG and there is nothing in there for the releases > 6.9.6 that mentions a fix for retried tests: https://github.com/cbeust/testng/blob/master/CHANGES.txt Am I looking in the wrong spot? — |
My Test :
@listeners({ ScreenshotListener.class })
public class TestRetryLogic {
@test(retryAnalyzer = Retry.class)
public void testRetryLogic() {
fail("Failing");
}
}
My Retry Analyzer :
public class Retry implements IRetryAnalyzer {
private final int maxRetryCountPerTest = 1;
private int retryCountPerTest = 0;
}
My Listener :
public class ScreenshotListener extends TestListenerAdapter {
}
My output:
Test STARTED
Test SKIPPED
Test STARTED
SKIPPED: testRetryLogic
java.lang.AssertionError: Failing
I would have expected :
Test STARTED
Test SKIPPED
Test STARTED
Test FAILED (Missing from above)
SKIPPED: testRetryLogic
java.lang.AssertionError: Failing
Is this a bug? Or is this expected?
Thank you.
The text was updated successfully, but these errors were encountered: