Re: my junit test fails due to "took longer than 10.0 seconds andtherefore failed"

Discussion in 'Java' started by Daniel Pitts, Apr 8, 2010.

  1. Daniel Pitts

    Daniel Pitts Guest

    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/>
    Daniel Pitts, Apr 8, 2010
    #1
    1. Advertising

  2. Daniel Pitts

    Tom Anderson Guest

    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
    Tom Anderson, Apr 9, 2010
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. aljodo
    Replies:
    3
    Views:
    3,054
    Peter Blum
    Aug 26, 2005
  2. Mumbai Joe
    Replies:
    0
    Views:
    583
    Mumbai Joe
    Jul 29, 2003
  3. Brian J. Sayatovic
    Replies:
    1
    Views:
    944
    Chris Uppal
    Jun 25, 2004
  4. Fresh
    Replies:
    2
    Views:
    617
    Bo Persson
    Apr 22, 2008
  5. eran
    Replies:
    6
    Views:
    678
    Gilbert Rebhan
    Aug 8, 2008
Loading...

Share This Page