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

wdoekes reviewboard at asterisk.org
Sun Jan 22 13:58:50 CST 2012


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

(Updated Jan. 22, 2012, 1:58 p.m.)


Review request for Asterisk Developers.


Changes
-------

Re-add ami_connect() super call per Matt's request. Move no_active_channels() to TestCase.

I'd like to add this -- i.e. CDR only -- to the running tests first before attempting to use it with more test cases. I get too many test failures on my local box (both with and without patch) to attempt to alter more test behaviour at once.


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 (updated)
-----

  asterisk/trunk/lib/python/asterisk/CDRTestCase.py 2991 
  asterisk/trunk/lib/python/asterisk/TestCase.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/20120122/9e59d986/attachment.htm>


More information about the asterisk-dev mailing list