Index: vm/tests/kernel/java/lang/ThreadTest.java =================================================================== --- vm/tests/kernel/java/lang/ThreadTest.java (revision 480001) +++ vm/tests/kernel/java/lang/ThreadTest.java (working copy) @@ -749,6 +749,9 @@ duration >= sleepTime); } + /** + * Test for void yield() + */ public void testYield() { ThreadYielding t1 = new ThreadYielding(1); ThreadYielding t2 = new ThreadYielding(2); @@ -761,7 +764,7 @@ fail(INTERRUPTED_MESSAGE); } int oneCount = 0; - int threadNum = ThreadYielding.dim / 2; + int threadNum = ThreadYielding.dim; for (int i = 0; i < threadNum; i++) { if (ThreadYielding.list[i] == 1) { oneCount++; @@ -772,7 +775,9 @@ // while t1 is yelding. In this case the 'list' might start with 1s // and end with 2s and look like threads does not alternate. // We cannot treat this as failure nevertheless. - assertTrue("threads have not yielded", oneCount < threadNum); + // We just make sure that both threads have finished successfully. + assertTrue("threads have not finished successfully", + oneCount == threadNum / 2); } /**