We are using testng 6.14.3
Tests are run from Java something like:
TestNG testng = new TestNG();
TestListenerAdapter tla = new TestListenerAdapter();
TestListener cla = new TestListener();
ClassListener cl = new ClassListener();
PriorityInterceptor pi = new PriorityInterceptor();
AnnotationTransformer at = new AnnotationTransformer();
testng.addListener(tla);
testng.addListener(cla);
testng.addListener(pi);
testng.addListener(at);
testng.addListener(cl);
// Add classes to run ....
try {
testng.run();
} catch (Exception e) {
Utilities.log(Const.Log.ERROR, "executeTestScript(): Unexpected error encountered; exception: " + e);
}
Our TestListener.onFinish() method has a log line at the beginning to indicate the start of the method but we never hit that line.
This passes 90% of the time and only fails 10% of the time. It started to fail around the time we switched to MySQL v8. I fully acknowledge that this is almost certainly NOT an issue with TestNg. The problem has got to be on our side somewhere. The problem is: I'm not sure how to figure out exactly what is going wrong.
From debugging, I can see that "Command line suite\Command line test.html" is created sometime between @AfterTest and TestListener.onFinish(), which is what I see when things fail too.
When it passes, I get a "Command line suite\Command line test.xml" & "Command line suite\testng-failed.xml" too. But when it fails, I do not. So, my current best guess is that something is failing when trying to create "Command line suite\Command line test.xml" (and/or "Command line suite\testng-failed.xml").
The rest of the content of "test-output" like "testng-results.xml" is not created until after testng.run() is done.
I will keep trying....