geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "gianny DAMOUR" <>
Subject Re: [status] build: SUCCESSFUL, test: FAILED | SunOS 5.8, 2004-05-15
Date Mon, 17 May 2004 12:41:18 GMT
David Blevins wrote:
>On Sat, May 15, 2004 at 09:40:00AM -0000, wrote:
> >     [junit] [ERROR] TEST 
>Interesting.  Any idea why this test failed when there were no code 
>changes?  Is this a problem withe testing techique or the code?

I think that this issue is related to an incorrect testing technique:

For instance, the method testDoWork creates three Threads. Each Thread 
submits to the WorkManager a mock Work via WorkManager.doWork. As the 
maximum pool size of this WorkManager is one, these three Works are 
Based on the time out provided to WorkManager.doWork (300ms) and the time 
that each Work waits (200ms), the first two Works should be WORK_COMPLETED 
when the three Threads have completed their WorkManager.doWork calls.

This assertion is true if the WorkManager is able to accept the second Work 
before its time out. In other words, it must accept the second Work before 
100ms (= 300ms - 200ms).

In some situation the WorkManager will not be able to accept the second Work 
within this time frame. For instance, the thread scheduling could be 
affected by a "significant" load. In such a case, testDoWork fails.

I have slightly updated this unit test in order to alleviate the above 
problem (the WorkManager has now 500ms to accept a Work). Though, I am not 
sure how to fix this problem for good.


Dialoguez en direct et gratuitement avec vos amis sur MSN Messenger !

View raw message