ThreadManagerTests.h blockTest can be more thorough
---------------------------------------------------

                 Key: THRIFT-466
                 URL: https://issues.apache.org/jira/browse/THRIFT-466
             Project: Thrift
          Issue Type: Bug
          Components: Test Suite
    Affects Versions: 0.1
         Environment: Mac OS X 10.5.6
            Reporter: Rush Manbert


At the point where the blockTest has created 100 tasks and it tries to add one 
more, but expects to timeout it does not catch TooManyPendingTasksException, 
whici is thrown if there is a bug in the call chain represented by canSleep(). 
In my case, my Boost thread implementation had a bug in the 
getCurrentThreadId() code that caused canSleep() to return false, which caused 
the exception to be thrown.

There is also no test for attempting to add the extra thread with a negative 
timeout value. In this case, TooManyPendingTasksException should be thrown and 
anything else is a bug.

I have a patch that modifies the existing try block and adds a second one that 
attempts to add the extra thread with a negative timeout value.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to