[asterisk-commits] tests/funcs/func talkdetect: Fix bouncing test. (testsuite[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jun 15 12:21:40 CDT 2016


Anonymous Coward #1000019 has submitted this change and it was merged.

Change subject: tests/funcs/func_talkdetect: Fix bouncing test.
......................................................................


tests/funcs/func_talkdetect: Fix bouncing test.

The test is running afoul of a race between starting a websocket
connection and starting the test call.  When the websocket is
connected, the HTTP response is sent before the stasis application
is truly ready to accept calls.  This is not an issue in the real
world because the two events are not likely to be synchronized.

* Added a one second wait in the dialplan for the initial call
before entering the stasis testsuite application.

ASTERISK-24988

Change-Id: Ic31e8d499b1feef3c4e2c313f7f3d47621e64d7f
---
M tests/funcs/func_talkdetect/configs/ast1/extensions.conf
M tests/funcs/func_talkdetect/test-config.yaml
2 files changed, 14 insertions(+), 6 deletions(-)

Approvals:
  George Joseph: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, approved



diff --git a/tests/funcs/func_talkdetect/configs/ast1/extensions.conf b/tests/funcs/func_talkdetect/configs/ast1/extensions.conf
index 587e233..6fd1219 100644
--- a/tests/funcs/func_talkdetect/configs/ast1/extensions.conf
+++ b/tests/funcs/func_talkdetect/configs/ast1/extensions.conf
@@ -71,7 +71,14 @@
 ; ARI application itself will release one end of the Local channel
 ; into the test after subscribing to it; both ARI/AMI listen for
 ; the events.
-exten => stasis_app,1,NoOp()
- same => n,Answer()
+;
+; The wait is required because of a race between connecting the ARI
+; websocket and the stasis application actually being ready to accept
+; calls.  This race condition is only apparent in a test environment
+; like this where connecting the websocket and generating a call that
+; must connect are synchronized.  The real world is not likely to
+; synchronize these two events.
+exten => stasis_app,1,Wait(1)
+ same => n(start),Answer()
  same => n,Stasis(testsuite,subscribe)
  same => n,Hangup()
diff --git a/tests/funcs/func_talkdetect/test-config.yaml b/tests/funcs/func_talkdetect/test-config.yaml
index 5aa3ceb..ffd90b2 100644
--- a/tests/funcs/func_talkdetect/test-config.yaml
+++ b/tests/funcs/func_talkdetect/test-config.yaml
@@ -47,7 +47,7 @@
             channel: 'Local/stasis_app at default'
             context: 'default'
             exten: 'stasis_app'
-            priority: '1'
+            priority: 'start'
             async: True
 
 ari-config:
@@ -112,12 +112,13 @@
     dependencies:
         - python : autobahn.websocket
         - python : requests
-        - python : twisted
         - python : starpy
+        - python : twisted
+        - asterisk : app_stack
+        - asterisk : app_stasis
+        - asterisk : func_talkdetect
         - asterisk : res_ari_channels
         - asterisk : res_ari_playbacks
-        - asterisk : func_talkdetect
-        - asterisk : app_stasis
         - asterisk : res_stasis
     tags:
         - ARI

-- 
To view, visit https://gerrit.asterisk.org/3025
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic31e8d499b1feef3c4e2c313f7f3d47621e64d7f
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>



More information about the asterisk-commits mailing list