[Asterisk-code-review] Confbridge test failures due to scenarios sometimes ending t... (testsuite[master])

Kevin Harwell asteriskteam at digium.com
Tue Oct 6 12:35:26 CDT 2015


Kevin Harwell has uploaded a new change for review.

  https://gerrit.asterisk.org/1390

Change subject: Confbridge test failures due to scenarios sometimes ending too early
......................................................................

Confbridge test failures due to scenarios sometimes ending too early

A few confbridge tests would sporadically fail because the scenario(s) would
end before all events had been processed. This happened because an "end"
scenario action was tied to a specific event, so once that event was received
it triggered the scenario to end. The test would end, but sometimes there
were available events still left to process.

This patch makes it so the test scenario will not end until all expected events
have been received, or a timeout occurs.

Change-Id: I3e067f7cd80568c9b507ca850771040d5fe2f593
---
M lib/python/asterisk/apptest.py
M tests/apps/confbridge/confbridge_dynamic_menus/test-config.yaml
M tests/apps/confbridge/confbridge_end_marked/test-config.yaml
M tests/apps/confbridge/confbridge_marked/test-config.yaml
M tests/apps/confbridge/confbridge_marked_unmarked/test-config.yaml
M tests/apps/confbridge/confbridge_result/test-config.yaml
M tests/apps/confbridge/confbridge_start_muted/test-config.yaml
M tests/apps/confbridge/confbridge_triple_lindy/test-config.yaml
M tests/apps/confbridge/confbridge_waitmarked_kick/test-config.yaml
M tests/apps/confbridge/confbridge_waitmarked_normal/test-config.yaml
M tests/apps/confbridge/confbridge_waitmarked_only/test-config.yaml
M tests/apps/confbridge/confbridge_waitmarked_single/test-config.yaml
12 files changed, 5 insertions(+), 51 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/90/1390/1

diff --git a/lib/python/asterisk/apptest.py b/lib/python/asterisk/apptest.py
index bb4d861..68796f7 100644
--- a/lib/python/asterisk/apptest.py
+++ b/lib/python/asterisk/apptest.py
@@ -185,7 +185,11 @@
         expected_result The name of the result that occurred
         """
         self._expected_results[expected_result] = True
-        self.reset_timeout()
+        # End a scenario once all events have been met it
+        if all(self._expected_results.itervalues()):
+            self.end_scenario()
+        else:
+            self.reset_timeout()
 
 
 class ChannelObject(object):
diff --git a/tests/apps/confbridge/confbridge_dynamic_menus/test-config.yaml b/tests/apps/confbridge/confbridge_dynamic_menus/test-config.yaml
index c55c959..ffb349b 100644
--- a/tests/apps/confbridge/confbridge_dynamic_menus/test-config.yaml
+++ b/tests/apps/confbridge/confbridge_dynamic_menus/test-config.yaml
@@ -43,8 +43,6 @@
             -
               action-type: 'set-expected-result'
               expected-result: 'Phase 0: Conference Ended'
-            -
-              action-type: 'end-scenario'
       channels:
         -
           channel-id: 'SingleOption'
@@ -113,8 +111,6 @@
             -
               action-type: 'set-expected-result'
               expected-result: 'Phase 1: Conference Ended'
-            -
-              action-type: 'end-scenario'
       channels:
         -
           channel-id: 'MultipleOptions'
@@ -199,8 +195,6 @@
             -
               action-type: 'set-expected-result'
               expected-result: 'Phase 2: Conference Ended'
-            -
-              action-type: 'end-scenario'
         -
           type: 'headermatch'
           conditions:
@@ -312,8 +306,6 @@
             -
               action-type: 'set-expected-result'
               expected-result: 'Phase 3: Conference Ended'
-            -
-              action-type: 'end-scenario'
       channels:
         -
           channel-id: 'MultipleOptions'
diff --git a/tests/apps/confbridge/confbridge_end_marked/test-config.yaml b/tests/apps/confbridge/confbridge_end_marked/test-config.yaml
index b6d9b75..7ea6ad5 100644
--- a/tests/apps/confbridge/confbridge_end_marked/test-config.yaml
+++ b/tests/apps/confbridge/confbridge_end_marked/test-config.yaml
@@ -118,8 +118,6 @@
               action-type: 'set-expected-result'
               delay: 2
               expected-result: 'Conference Ended'
-            -
-              action-type: 'end-scenario'
       channels:
         -
           channel-id: 'Waitmarked-user'
diff --git a/tests/apps/confbridge/confbridge_marked/test-config.yaml b/tests/apps/confbridge/confbridge_marked/test-config.yaml
index 3359057..1758d78 100644
--- a/tests/apps/confbridge/confbridge_marked/test-config.yaml
+++ b/tests/apps/confbridge/confbridge_marked/test-config.yaml
@@ -104,8 +104,6 @@
             -
               action-type: 'set-expected-result'
               expected-result: 'Conference Ended'
-            -
-              action-type: 'end-scenario'
       channels:
         -
           channel-id: 'Marked-1'
@@ -290,8 +288,6 @@
             -
               action-type: 'set-expected-result'
               expected-result: 'Conference Ended'
-            -
-              action-type: 'end-scenario'
       channels:
         -
           channel-id: 'Marked-1'
diff --git a/tests/apps/confbridge/confbridge_marked_unmarked/test-config.yaml b/tests/apps/confbridge/confbridge_marked_unmarked/test-config.yaml
index 13e4c8a..1d9b4a5 100644
--- a/tests/apps/confbridge/confbridge_marked_unmarked/test-config.yaml
+++ b/tests/apps/confbridge/confbridge_marked_unmarked/test-config.yaml
@@ -107,8 +107,6 @@
             -
               action-type: 'set-expected-result'
               expected-result: 'Conference Ended'
-            -
-              action-type: 'end-scenario'
       channels:
         -
           channel-id: 'Marked-user'
@@ -300,8 +298,6 @@
             -
               action-type: 'set-expected-result'
               expected-result: 'Conference Ended'
-            -
-              action-type: 'end-scenario'
       channels:
         -
           channel-id: 'Marked-user'
@@ -489,8 +485,6 @@
             -
               action-type: 'set-expected-result'
               expected-result: 'Conference Ended'
-            -
-              action-type: 'end-scenario'
       channels:
         -
           channel-id: 'Marked-user'
diff --git a/tests/apps/confbridge/confbridge_result/test-config.yaml b/tests/apps/confbridge/confbridge_result/test-config.yaml
index b940e69..e78efd5 100644
--- a/tests/apps/confbridge/confbridge_result/test-config.yaml
+++ b/tests/apps/confbridge/confbridge_result/test-config.yaml
@@ -49,8 +49,6 @@
                         -
                             action-type: 'set-expected-result'
                             expected-result: 'Conference Ended'
-                        -
-                            action-type: 'end-scenario'
             channels:
                 -
                     channel-id: 'Alice'
@@ -261,8 +259,6 @@
                         -
                             action-type: 'set-expected-result'
                             expected-result: 'Conference Ended'
-                        -
-                            action-type: 'end-scenario'
             channels:
                 -
                     channel-id: 'Alice'
diff --git a/tests/apps/confbridge/confbridge_start_muted/test-config.yaml b/tests/apps/confbridge/confbridge_start_muted/test-config.yaml
index 8a48892..4164058 100644
--- a/tests/apps/confbridge/confbridge_start_muted/test-config.yaml
+++ b/tests/apps/confbridge/confbridge_start_muted/test-config.yaml
@@ -35,8 +35,6 @@
                         -
                             action-type: 'set-expected-result'
                             expected-result: 'Conference Ended'
-                        -
-                            action-type: 'end-scenario'
             channels:
                 -
                     channel-id: 'Alice'
diff --git a/tests/apps/confbridge/confbridge_triple_lindy/test-config.yaml b/tests/apps/confbridge/confbridge_triple_lindy/test-config.yaml
index 1b4d6b4..0ca97af 100644
--- a/tests/apps/confbridge/confbridge_triple_lindy/test-config.yaml
+++ b/tests/apps/confbridge/confbridge_triple_lindy/test-config.yaml
@@ -125,8 +125,6 @@
               action-type: 'set-expected-result'
               delay: 2
               expected-result: 'Conference Ended'
-            -
-              action-type: 'end-scenario'
       channels:
         -
           channel-id: 'Waitmarked-user'
@@ -384,8 +382,6 @@
               action-type: 'set-expected-result'
               delay: 2
               expected-result: 'Conference Ended'
-            -
-              action-type: 'end-scenario'
       channels:
         -
           channel-id: 'Waitmarked-user'
@@ -622,8 +618,6 @@
               action-type: 'set-expected-result'
               delay: 2
               expected-result: 'Conference ended'
-            -
-              action-type: 'end-scenario'
         -
           type: 'headermatch'
           conditions:
@@ -870,8 +864,6 @@
               action-type: 'set-expected-result'
               delay: 2
               expected-result: 'Conference ended'
-            -
-              action-type: 'end-scenario'
         -
           type: 'headermatch'
           conditions:
diff --git a/tests/apps/confbridge/confbridge_waitmarked_kick/test-config.yaml b/tests/apps/confbridge/confbridge_waitmarked_kick/test-config.yaml
index 11edfb9..0e59d41 100644
--- a/tests/apps/confbridge/confbridge_waitmarked_kick/test-config.yaml
+++ b/tests/apps/confbridge/confbridge_waitmarked_kick/test-config.yaml
@@ -102,8 +102,6 @@
             -
               action-type: 'set-expected-result'
               expected-result: 'Channels exited conference'
-            -
-              action-type: 'end-scenario'
       channels:
         -
           channel-id: 'Marked'
diff --git a/tests/apps/confbridge/confbridge_waitmarked_normal/test-config.yaml b/tests/apps/confbridge/confbridge_waitmarked_normal/test-config.yaml
index 3da3986..8ea8b9a 100644
--- a/tests/apps/confbridge/confbridge_waitmarked_normal/test-config.yaml
+++ b/tests/apps/confbridge/confbridge_waitmarked_normal/test-config.yaml
@@ -103,8 +103,6 @@
             -
               action-type: 'set-expected-result'
               expected-result: 'Conference Ended'
-            -
-              action-type: 'end-scenario'
       channels:
         -
           channel-id: 'Normal_user'
@@ -276,8 +274,6 @@
             -
               action-type: 'set-expected-result'
               expected-result: 'Conference Ended'
-            -
-              action-type: 'end-scenario'
       channels:
         -
           channel-id: 'Normal_user'
@@ -454,8 +450,6 @@
             -
               action-type: 'set-expected-result'
               expected-result: 'Conference Ended'
-            -
-              action-type: 'end-scenario'
       channels:
         -
           channel-id: 'Normal_user'
diff --git a/tests/apps/confbridge/confbridge_waitmarked_only/test-config.yaml b/tests/apps/confbridge/confbridge_waitmarked_only/test-config.yaml
index 59fb4b6..4083792 100644
--- a/tests/apps/confbridge/confbridge_waitmarked_only/test-config.yaml
+++ b/tests/apps/confbridge/confbridge_waitmarked_only/test-config.yaml
@@ -72,8 +72,6 @@
               action-type: 'set-expected-result'
               delay: 2
               expected-result: 'Conference Ended'
-            -
-              action-type: 'end-scenario'
         -
           type: 'headermatch'
           conditions:
diff --git a/tests/apps/confbridge/confbridge_waitmarked_single/test-config.yaml b/tests/apps/confbridge/confbridge_waitmarked_single/test-config.yaml
index ae18d20..2add17d 100644
--- a/tests/apps/confbridge/confbridge_waitmarked_single/test-config.yaml
+++ b/tests/apps/confbridge/confbridge_waitmarked_single/test-config.yaml
@@ -102,8 +102,6 @@
             -
               action-type: 'set-expected-result'
               expected-result: 'Conference Ended'
-            -
-              action-type: 'end-scenario'
       channels:
         -
           channel-id: 'Marked'
@@ -253,8 +251,6 @@
             -
               action-type: 'set-expected-result'
               expected-result: 'Conference Ended'
-            -
-              action-type: 'end-scenario'
       channels:
         -
           channel-id: 'Marked'
@@ -400,8 +396,6 @@
             -
               action-type: 'set-expected-result'
               expected-result: 'Conference Ended'
-            -
-              action-type: 'end-scenario'
       channels:
         -
           channel-id: 'Marked'

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3e067f7cd80568c9b507ca850771040d5fe2f593
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>



More information about the asterisk-code-review mailing list