[Asterisk-code-review] tests/funcs/func talkdetect: Fix bouncing test. (testsuite[master])
Richard Mudgett
asteriskteam at digium.com
Tue Jun 14 13:31:06 CDT 2016
Richard Mudgett has uploaded a new change for review.
https://gerrit.asterisk.org/3025
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(-)
git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/25/3025/1
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: newchange
Gerrit-Change-Id: Ic31e8d499b1feef3c4e2c313f7f3d47621e64d7f
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
More information about the asterisk-code-review
mailing list