Author: mjordan
Date: Sat Dec  6 10:29:14 2014
New Revision: 6026

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=6026
Log:
rest_api/applications/double-subscribe-device-state: Fix test stop race

The double-subscribe-device-state test uses a Local channel to trigger the test
logic. The default behaviour of the test object is to stop the reactor when the
channel hangs up. However, there is no guarantee that the device state changes
have all propagated and the ARI events been received. This patch makes it so
that the test object doesn't stop the reactor on channel hang up - instead, the
handling of the device state triggers the reactor stop.

Modified:
    
asterisk/trunk/tests/rest_api/applications/double-subscribe-device-state/subscribe_device_state.py
    
asterisk/trunk/tests/rest_api/applications/double-subscribe-device-state/test-config.yaml

Modified: 
asterisk/trunk/tests/rest_api/applications/double-subscribe-device-state/subscribe_device_state.py
URL: 
http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/applications/double-subscribe-device-state/subscribe_device_state.py?view=diff&rev=6026&r1=6025&r2=6026
==============================================================================
--- 
asterisk/trunk/tests/rest_api/applications/double-subscribe-device-state/subscribe_device_state.py
 (original)
+++ 
asterisk/trunk/tests/rest_api/applications/double-subscribe-device-state/subscribe_device_state.py
 Sat Dec  6 10:29:14 2014
@@ -39,4 +39,5 @@
 def on_state_change(ari, event, obj):
     assert event['device_state']['name'] == DEVICE
     assert event['device_state']['state'] == CHANGED_STATE
+    obj.stop_reactor()
     return True

Modified: 
asterisk/trunk/tests/rest_api/applications/double-subscribe-device-state/test-config.yaml
URL: 
http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/rest_api/applications/double-subscribe-device-state/test-config.yaml?view=diff&rev=6026&r1=6025&r2=6026
==============================================================================
--- 
asterisk/trunk/tests/rest_api/applications/double-subscribe-device-state/test-config.yaml
 (original)
+++ 
asterisk/trunk/tests/rest_api/applications/double-subscribe-device-state/test-config.yaml
 Sat Dec  6 10:29:14 2014
@@ -12,6 +12,9 @@
     modules:
         -   config-section: ari-config
             typename: ari.WebSocketEventModule
+
+test-object-config:
+    stop-on-end: False
 
 ari-config:
     events:


-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

svn-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/svn-commits

Reply via email to