[Telepathy-commits] [telepathy-gabble/master] Fix race in tests: do not request a channel before Gabble receive the caps

Alban Crequy alban.crequy at collabora.co.uk
Tue Aug 19 10:52:22 PDT 2008


20080521174000-a41c0-6890d3421577c30998884358f8394be776d08ba2.gz
---
 tests/twisted/jingle/hold-audio.py                 |    5 ++++-
 tests/twisted/jingle/hold-av.py                    |    5 ++++-
 tests/twisted/jingle/test-incoming-call.py         |    5 ++++-
 .../jingle/test-outgoing-call-deprecated.py        |    5 ++++-
 .../jingle/test-outgoing-call-deprecated2.py       |    5 ++++-
 .../twisted/jingle/test-outgoing-call-rejected.py  |    5 ++++-
 tests/twisted/jingle/test-outgoing-call.py         |    5 ++++-
 7 files changed, 28 insertions(+), 7 deletions(-)

diff --git a/tests/twisted/jingle/hold-audio.py b/tests/twisted/jingle/hold-audio.py
index 5f1c710..8d03383 100644
--- a/tests/twisted/jingle/hold-audio.py
+++ b/tests/twisted/jingle/hold-audio.py
@@ -2,7 +2,7 @@
 Test the Hold API.
 """
 
-from gabbletest import exec_test, make_result_iq, acknowledge_iq
+from gabbletest import exec_test, make_result_iq, acknowledge_iq, sync_stream
 from servicetest import make_channel_proxy, unwrap, tp_path_prefix, \
         call_async, EventPattern
 import jingletest
@@ -47,6 +47,9 @@ def test(q, bus, conn, stream):
 
     jt.send_remote_disco_reply(event.stanza)
 
+    # Force Gabble to process the caps before calling RequestChannel
+    sync_stream(q, stream)
+
     handle = conn.RequestHandles(1, [jt.remote_jid])[0]
 
     path = conn.RequestChannel(
diff --git a/tests/twisted/jingle/hold-av.py b/tests/twisted/jingle/hold-av.py
index 9ace19b..c209b92 100644
--- a/tests/twisted/jingle/hold-av.py
+++ b/tests/twisted/jingle/hold-av.py
@@ -2,7 +2,7 @@
 Test the Hold API.
 """
 
-from gabbletest import exec_test, make_result_iq, acknowledge_iq
+from gabbletest import exec_test, make_result_iq, acknowledge_iq, sync_stream
 from servicetest import make_channel_proxy, unwrap, tp_path_prefix, \
         call_async, EventPattern
 import jingletest
@@ -48,6 +48,9 @@ def test(q, bus, conn, stream):
 
     jt.send_remote_disco_reply(event.stanza)
 
+    # Force Gabble to process the caps before calling RequestChannel
+    sync_stream(q, stream)
+
     handle = conn.RequestHandles(1, [jt.remote_jid])[0]
 
     path = conn.RequestChannel(
diff --git a/tests/twisted/jingle/test-incoming-call.py b/tests/twisted/jingle/test-incoming-call.py
index 6ed80b8..97b5e04 100644
--- a/tests/twisted/jingle/test-incoming-call.py
+++ b/tests/twisted/jingle/test-incoming-call.py
@@ -7,7 +7,7 @@ print "FIXME: jingle/test-incoming-call.py disabled due to race condition"
 # exiting 77 causes automake to consider the test to have been skipped
 raise SystemExit(77)
 
-from gabbletest import exec_test, make_result_iq
+from gabbletest import exec_test, make_result_iq, sync_stream
 from servicetest import make_channel_proxy, unwrap, tp_path_prefix
 import jingletest
 import gabbletest
@@ -39,6 +39,9 @@ def test(q, bus, conn, stream):
 
     jt.send_remote_disco_reply(event.stanza)
 
+    # Force Gabble to process the caps before calling RequestChannel
+    sync_stream(q, stream)
+
     remote_handle = conn.RequestHandles(1, ["foo at bar.com/Foo"])[0]
 
     # SCENARIO 1 - We reject incoming call
diff --git a/tests/twisted/jingle/test-outgoing-call-deprecated.py b/tests/twisted/jingle/test-outgoing-call-deprecated.py
index 6242c25..fa3381f 100644
--- a/tests/twisted/jingle/test-outgoing-call-deprecated.py
+++ b/tests/twisted/jingle/test-outgoing-call-deprecated.py
@@ -4,7 +4,7 @@ Test outgoing call handling. This tests the happy scenario
 when the remote party accepts the call.
 """
 
-from gabbletest import exec_test, make_result_iq
+from gabbletest import exec_test, make_result_iq, sync_stream
 from servicetest import make_channel_proxy, unwrap, tp_path_prefix
 import jingletest
 import gabbletest
@@ -36,6 +36,9 @@ def test(q, bus, conn, stream):
 
     jt.send_remote_disco_reply(event.stanza)
 
+    # Force Gabble to process the caps before calling RequestChannel
+    sync_stream(q, stream)
+
     handle = conn.RequestHandles(1, [jt.remote_jid])[0]
 
     path = conn.RequestChannel(
diff --git a/tests/twisted/jingle/test-outgoing-call-deprecated2.py b/tests/twisted/jingle/test-outgoing-call-deprecated2.py
index 69a56e6..fbe51ec 100644
--- a/tests/twisted/jingle/test-outgoing-call-deprecated2.py
+++ b/tests/twisted/jingle/test-outgoing-call-deprecated2.py
@@ -4,7 +4,7 @@ Test outgoing call handling. This tests the happy scenario
 when the remote party accepts the call.
 """
 
-from gabbletest import exec_test, make_result_iq
+from gabbletest import exec_test, make_result_iq, sync_stream
 from servicetest import make_channel_proxy, unwrap, tp_path_prefix
 import jingletest
 import gabbletest
@@ -36,6 +36,9 @@ def test(q, bus, conn, stream):
 
     jt.send_remote_disco_reply(event.stanza)
 
+    # Force Gabble to process the caps before calling RequestChannel
+    sync_stream(q, stream)
+
     handle = conn.RequestHandles(1, [jt.remote_jid])[0]
 
     path = conn.RequestChannel(
diff --git a/tests/twisted/jingle/test-outgoing-call-rejected.py b/tests/twisted/jingle/test-outgoing-call-rejected.py
index 000cc68..b1bc338 100644
--- a/tests/twisted/jingle/test-outgoing-call-rejected.py
+++ b/tests/twisted/jingle/test-outgoing-call-rejected.py
@@ -4,7 +4,7 @@ Test outgoing call handling. This tests the case when the
 remote party rejects our call.
 """
 
-from gabbletest import exec_test, make_result_iq
+from gabbletest import exec_test, make_result_iq, sync_stream
 from servicetest import make_channel_proxy, unwrap, tp_path_prefix
 import jingletest
 import gabbletest
@@ -35,6 +35,9 @@ def test(q, bus, conn, stream):
 
     jt.send_remote_disco_reply(event.stanza)
 
+    # Force Gabble to process the caps before calling RequestChannel
+    sync_stream(q, stream)
+
     handle = conn.RequestHandles(1, [jt.remote_jid])[0]
 
     path = conn.RequestChannel(
diff --git a/tests/twisted/jingle/test-outgoing-call.py b/tests/twisted/jingle/test-outgoing-call.py
index cee66a2..613a94f 100644
--- a/tests/twisted/jingle/test-outgoing-call.py
+++ b/tests/twisted/jingle/test-outgoing-call.py
@@ -4,7 +4,7 @@ Test outgoing call handling. This tests the happy scenario
 when the remote party accepts the call.
 """
 
-from gabbletest import exec_test, make_result_iq
+from gabbletest import exec_test, make_result_iq, sync_stream
 from servicetest import make_channel_proxy, unwrap, tp_path_prefix
 from twisted.words.xish import domish
 import jingletest
@@ -37,6 +37,9 @@ def test(q, bus, conn, stream):
 
     jt.send_remote_disco_reply(event.stanza)
 
+    # Force Gabble to process the caps before calling RequestChannel
+    sync_stream(q, stream)
+
     handle = conn.RequestHandles(1, [jt.remote_jid])[0]
 
     path = conn.RequestChannel(
-- 
1.5.6.3




More information about the Telepathy-commits mailing list