> Try replacing the nap with: System.out.flush(); and see what happens.

Thanks, that would do it. I'm tempted to add it as an @After in testng, just in 
case. Tempting to ask for it as a built-in feature in testng. 
In this case I didn't need the temporary printlns to show, beyond making sure 
the test was working correctly.

Bill

-----Original Message-----
From: Eric Siegerman [mailto:[email protected]] 
Sent: Thursday, October 24, 2013 11:56 AM
To: [email protected]
Subject: Re: [Xmlunit-general] Diff.similar() seems to cause thread to exit 
50%+ of the time

On 10/23/2013 03:31 PM, Bill Ross wrote:
 > It looks like this is an artifact of println rather than XMLUnit: 
when I add this to the end of my test, it triggers ok:
 > System.out.println("@@@");
 > //napMilliSeconds(2000);
 > Assert.fail("Should fail here.");
 >
 > With the 'nap', all the prints appear, but in any case the assert is reached 
 > and fires.

So, are you saying that:
- with the nap, you get both the System.out output and the "Should fail here" 
test failure, as expected?
- without the nap, you get the (still-expected) test failure, but nothing 
printed on System.out?

If so, it sounds as though, when the test finishes (whether failing, as here, 
or passing, as in your original post), System.out's buffer is discarded instead 
of being flushed. I'm not sure why that would be timing-dependent.

Try replacing the nap with:
System.out.flush();
and see what happens.

Also try removing XmlUnit from the equation entirely.

I'd do both of those at once by making a set of tests that do:
{XmlUnit code | nothing}
println // The other 12 combinations, without the println, are of no interest 
{nap | flush | nothing} {fail | nothing}

And see which ones do or do not produce the println output.

If, as I expect:
- nap and flush both cause the println output to appear, but with neither of 
them, it's suppressed
- presence or absence of the preceding XmlUnit stuff makes no difference
- presence or absence of the final Assert.fail call also makes no difference 
then you have a solid bug report for the IntelliJ folks :-)

(Of course, it being timing-dependent, the results may not be entirely 
identical from run to run. I'd expect nap (and flush, if my theory is
correct) to *reliably* produce the output, but having neither of them to only 
sometimes suppress it.)

- Eric


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register > 
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg..clktrk
_______________________________________________
Xmlunit-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xmlunit-general
---------------------------------------------------------------------------------
The information transmitted in this email is intended only for the person or 
entity to which it is addressed, and may contain material confidential to Xoom 
Corporation, and/or its subsidiary, buyindiaonline.com Inc.  Any review, 
retransmission, dissemination or other use of, or taking of any action in 
reliance upon, this information by persons or entities other than the intended 
recipient(s) is prohibited.   If you received this email in error, please 
contact the sender and delete the material from your files.



------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
Xmlunit-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xmlunit-general

Reply via email to