testng-results.xml does not seem to track multi-threaded data provider failures properly

27 views
Skip to first unread message

Andrew McElroy

unread,
Sep 14, 2016, 10:51:52 AM9/14/16
to testng-users
I am using a multi-treaded DP.  I initiate via java:

TestNG testng = new TestNG();
testng
.setDataProviderThreadCount(4);

Then my DP has the "parallel = true" option.

My test method logs the thread id at the beginning and end of the test case: Thread.currentThread().getId()

4 of the iterations fail.  The testng-failed.xml file seems to track this:

      <class name="blah.vtestapi.cm.features.reporting.Advanced">
        <methods>
          <include name="testExecuteSuccessfully" invocation-numbers="7 16 18 43"/>
          <include name="beforeTest"/>
          <include name="beforeClass"/>
        </methods>
      </class> <!--blah.vtestapi.cm.features.reporting.Advanced -->

But testng-results.xml does not seem to store any info as to which invocation it's reporting on. The <message> and <full-stacktrace> sections in testng-results.xml report all my output including my Thread.currentThread().getId() lines.  It reports one thread id at the beginning of the test and a different thread id at the end of the test.

It looks like testng is not properly grouping the logs from the different threads.  Is this a problem with how I'm logging?  TestNg bug?  

Thanks.

Andrew McElroy

unread,
Sep 14, 2016, 11:26:54 AM9/14/16
to testng-users
I wonder if it's a problem with my logging method being static?

⇜Krishnan Mahadevan⇝

unread,
Sep 17, 2016, 10:35:08 PM9/17/16
to testng...@googlegroups.com
Andrew,

Which report are you referring to ? Can you please help call that out.
Also it would be good if you can please help share a sample which can be used to recreate the problem you are experiencing.

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 Wed, Sep 14, 2016 at 8:56 PM, Andrew McElroy <andrew....@veeva.com> wrote:
I wonder if it's a problem with my logging method being static?

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to testng...@googlegroups.com.
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages