[asterisk-commits] mnicholson: testsuite/asterisk/trunk r431 - /asterisk/trunk/tests/manager-act...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Jun 24 12:18:11 CDT 2010
Author: mnicholson
Date: Thu Jun 24 12:18:08 2010
New Revision: 431
URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=431
Log:
Make the manager-action-events-response test run much faster
Modified:
asterisk/trunk/tests/manager-action-events-response/test.lua
Modified: asterisk/trunk/tests/manager-action-events-response/test.lua
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/manager-action-events-response/test.lua?view=diff&rev=431&r1=430&r2=431
==============================================================================
--- asterisk/trunk/tests/manager-action-events-response/test.lua (original)
+++ asterisk/trunk/tests/manager-action-events-response/test.lua Thu Jun 24 12:18:08 2010
@@ -26,13 +26,25 @@
got_response = r
end
+ -- send an Events action
r = check_err("error sending 'Events' action", m(ma, handle_response))
- posix.sleep(3)
+
+ -- wait for a response
+ local time_string
+ if expected_response then
+ time_string = "half a second (500 milliseconds)"
+ posix.usleep(500000)
+ else
+ time_string = "one second"
+ posix.sleep(1)
+ end
+
+ -- check for a response
check_err("manager error", m:pump_messages())
m:process_responses()
if not got_response and expected_response then
- fail("did not get a response to the 'Events' manager action in 3 seconds")
+ fail("did not get a response to the 'Events' manager action in " .. time_string)
elseif got_response and not expected_response then
fail("got a response to the 'Events' manager action when we did not expect one:\n" .. got_response:_format())
end
More information about the asterisk-commits
mailing list