#6 Listener Tests Hang

v0.5-b2
closed-fixed
core (4)
5
2004-07-04
2004-06-21
No

in ListenerTest and ListenerCloseTest you have a lock
waiting for a message, on the WaitingListener:

listener.waitForReceipt()

I have come up with the problem where if there is no
message being received by the listener this just keeps
the thread locked and effectively hangs the tests.

I suggest the following:

add following method to WaitingListener:

public boolean waitForReceipt(int timeout) throws

InterruptedException {

return _receiptLock.attempt(timeout);

}

and change code in ListenerTest and ListenerCloseTest
to be

as follows:

if(!listener.waitForReceipt(5000)){

log.warn("5 second waiting for
listener exceeded");

throw new Exception("5 second
timeout exceeded

waiting for listener");

}

Discussion

  • Tim Anderson

    Tim Anderson - 2004-07-04
    • assigned_to: nobody --> tanderson
    • status: open --> closed-fixed
     
  • Tim Anderson

    Tim Anderson - 2004-07-04

    Logged In: YES
    user_id=557161

    Changes applied in CVS. Many thanks!

     

Log in to post a comment.