From: Daniel Pitts on
On 4/8/2010 11:03 AM, www wrote:
> Hi,
>
> I have a junit test which runs 60 years data (the testing purpose is to
> make sure the program can handle long period computation).
>
> But recently, this test occasionally fails. (We develop on linux). When
> the machine is busy, this test fails, with the error message:
>
> "The run for xxxx took longer than 10.0 seconds and therefore failed".
>
> This problem happens from running in Eclipse or on terminal using ant.
>
> Can you help me on that?
>
> Thank you very much.
It sounds like your code has a timeout value somewhere (not a part of
JUnit AFAIK). It is that code which should be changed, or hopefully its
a configuration parameter, if the original developer had foresight.



--
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
From: Tom Anderson on
On Thu, 8 Apr 2010, Daniel Pitts wrote:

> On 4/8/2010 11:03 AM, www wrote:
>
>> I have a junit test which runs 60 years data (the testing purpose is to
>> make sure the program can handle long period computation).
>>
>> But recently, this test occasionally fails. (We develop on linux). When
>> the machine is busy, this test fails, with the error message:
>>
>> "The run for xxxx took longer than 10.0 seconds and therefore failed".
>>
>> This problem happens from running in Eclipse or on terminal using ant.
>
> It sounds like your code has a timeout value somewhere (not a part of JUnit
> AFAIK).

Definitely not a part of JUnit. We have JUnit tests, which we run in
Eclipse and from the command line, which take much longer than 10 seconds.

Much, much longer.

Does the error message come in the form of an exception? If so, the stack
trace will tell you where it came from, which is a good way to start
finding out why it was produced.

tom

--
In-jokes for out-casts
From: www on
Thank you all. You are right. There is code there explicitly checking
the total run time. If it is more than 10 seconds, fails the test.

Sorry. I should have combed through the test code before posting the
question. I thought it is a junit thing.
From: Daniel Pitts on
On 4/9/2010 5:24 AM, www wrote:
> Thank you all. You are right. There is code there explicitly checking
> the total run time. If it is more than 10 seconds, fails the test.
>
> Sorry. I should have combed through the test code before posting the
> question. I thought it is a junit thing.
It isn't entirely your fault, the error message didn't give you enough
context to identify the real problem. The developer of that "feature"
of your unit-tests failed in that regard.

--
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>