[asterisk-dev] [Code Review] speedup of cdrtestcase by not waiting for reactor timeout

Matt Jordan reviewboard at asterisk.org
Mon Jan 16 09:13:59 CST 2012


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1671/#review5175
-----------------------------------------------------------



asterisk/trunk/lib/python/asterisk/CDRTestCase.py
<https://reviewboard.asterisk.org/r/1671/#comment9654>

    Granted, ami_connect doesn't do anything in TestCase right now - but its probably not a bad idea to keep this, in case any behavior is added to the base class that all derived classes need... such as your hangup checking code



asterisk/trunk/lib/python/asterisk/CDRTestCase.py
<https://reviewboard.asterisk.org/r/1671/#comment9655>

    Speaking of which - why don't we put this in TestCase?  I can't see how this will hurt any of the current tests, as it doesn't stop the test if any channels are still up and running and doing work.  I know we have a few other tests that simply wait for their reactors to time out - this has the potential to speed up a bunch of tests.


- Matt


On Jan. 15, 2012, 3:16 p.m., wdoekes wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1671/
> -----------------------------------------------------------
> 
> (Updated Jan. 15, 2012, 3:16 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> Most CDR test cases simply waited for the reactor timeout to fire. Only the tests that had a failing call were terminated in a timely fashion.
> 
> Add a check for the Hangup and count 0 active channels.
> 
> 
> Diffs
> -----
> 
>   asterisk/trunk/lib/python/asterisk/CDRTestCase.py 2991 
>   asterisk/trunk/lib/python/asterisk/asterisk.py 2991 
>   asterisk/trunk/tests/cdr/console_dial_sip_answer/run-test 2991 
>   asterisk/trunk/tests/cdr/console_dial_sip_busy/run-test 2991 
> 
> Diff: https://reviewboard.asterisk.org/r/1671/diff
> 
> 
> Testing
> -------
> 
> 5 out of 8 CDR tests run faster now.
> 
> Before:
> 
> --> Running test 'tests/cdr/console_dial_sip_busy' ...
> <testsuite errors="0" failures="0" name="AsteriskTestSuite" tests="1" time="3.40">
> --> Cannot run test 'tests/cdr/console_dial_sip_transfer'
> <testsuite errors="0" failures="0" name="AsteriskTestSuite" tests="0" time="0.00"/>
> --> Running test 'tests/cdr/console_dial_sip_answer' ...
> <testsuite errors="0" failures="0" name="AsteriskTestSuite" tests="1" time="33.28">
> --> Running test 'tests/cdr/cdr_unanswered_yes' ...
> <testsuite errors="0" failures="0" name="AsteriskTestSuite" tests="1" time="3.60">
> --> Running test 'tests/cdr/console_dial_sip_congestion' ...
> <testsuite errors="0" failures="0" name="AsteriskTestSuite" tests="1" time="3.44">
> --> Running test 'tests/cdr/console_fork_after_busy_forward' ...
> <testsuite errors="0" failures="0" name="AsteriskTestSuite" tests="1" time="33.25">
> --> Cannot run test 'tests/cdr/cdr_originate_sip_congestion_log'
> <testsuite errors="0" failures="0" name="AsteriskTestSuite" tests="0" time="0.00"/>
> --> Running test 'tests/cdr/console_fork_before_dial' ...
> <testsuite errors="0" failures="0" name="AsteriskTestSuite" tests="1" time="33.21">
> --> Running test 'tests/cdr/cdr_userfield' ...
> <testsuite errors="0" failures="0" name="AsteriskTestSuite" tests="1" time="33.21">
> --> Running test 'tests/cdr/nocdr' ...
> <testsuite errors="0" failures="0" name="AsteriskTestSuite" tests="1" time="33.21">
> 
> After:
> 
> --> Running test 'tests/cdr/console_dial_sip_busy' ...
> <testsuite errors="0" failures="0" name="AsteriskTestSuite" tests="1" time="4.55">
> --> Cannot run test 'tests/cdr/console_dial_sip_transfer'
> <testsuite errors="0" failures="0" name="AsteriskTestSuite" tests="0" time="0.00"/>
> --> Running test 'tests/cdr/console_dial_sip_answer' ...
> <testsuite errors="0" failures="0" name="AsteriskTestSuite" tests="1" time="4.26">
> --> Running test 'tests/cdr/cdr_unanswered_yes' ...
> <testsuite errors="0" failures="0" name="AsteriskTestSuite" tests="1" time="3.62">
> --> Running test 'tests/cdr/console_dial_sip_congestion' ...
> <testsuite errors="0" failures="0" name="AsteriskTestSuite" tests="1" time="5.10">
> --> Running test 'tests/cdr/console_fork_after_busy_forward' ...
> <testsuite errors="0" failures="0" name="AsteriskTestSuite" tests="1" time="5.05">
> --> Cannot run test 'tests/cdr/cdr_originate_sip_congestion_log'
> <testsuite errors="0" failures="0" name="AsteriskTestSuite" tests="0" time="0.00"/>
> --> Running test 'tests/cdr/console_fork_before_dial' ...
> <testsuite errors="0" failures="0" name="AsteriskTestSuite" tests="1" time="7.78">
> --> Running test 'tests/cdr/cdr_userfield' ...
> <testsuite errors="0" failures="0" name="AsteriskTestSuite" tests="1" time="4.06">
> --> Running test 'tests/cdr/nocdr' ...
> <testsuite errors="0" failures="0" name="AsteriskTestSuite" tests="1" time="3.95">
> 
> 
> Thanks,
> 
> wdoekes
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20120116/8d665616/attachment-0001.htm>


More information about the asterisk-dev mailing list