Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
HBase >> mail # dev >> junit 4.11 / JDK 1.7 and test methods execution order.

Nicolas Liochon 2013-01-14, 13:57
Copy link to this message
Re: junit 4.11 / JDK 1.7 and test methods execution order.
Interesting.  It's probably good to randomize test ordering.  Are the
classes that failed supposed to be executed in order? (non independent
test cases?)

I found this when I was looking if there was an option to keep the older style.


On Mon, Jan 14, 2013 at 5:57 AM, Nicolas Liochon <[EMAIL PROTECTED]> wrote:
> Hi all,
> In JDK 1.7, the order of the methods returned by reflection can vary. While
> the ordering was not guaranteed previously, it happens that it was always
> the same (declaration order). It's not the case anymore in JDK 1.7
> Consequence for the tests: the order in which the tests are executed within
> a test class may vary.
> Because of this, JUnit 4.11 decided to execute the tests in a different
> order than the declaration order.
> That's explained here:
> http://randomallsorts.blogspot.fr/2012/12/junit-411-whats-new-test-execution-order.html
> So depending on the execution order used to be bad, but can now randomly
> breaks the tests, especially with jdk 1.7 and JUnit < 4.11.
> With JUnit 4.11, the order is determined, but different from what it used
> to be. So it breaks some tests. I'm currently fixing this (low priority).
> But it's worth knowing, especially if you port the tests from one HBase
> version to another.
> Cheers,
> Nicolas

// Jonathan Hsieh (shay)
// Software Engineer, Cloudera
Nicolas Liochon 2013-01-14, 16:33
Andrew Purtell 2013-01-14, 19:39