[Telepathy-commits] [telepathy-idle/master] Speed up the tests a bit

Jonathon Jongsma jonathon.jongsma at collabora.co.uk
Fri Feb 13 17:43:19 PST 2009


When I was figuring out the test framework and trying to get things to work, I
had bumped up the time out on a bunch of tests to 10s rather than the default 5.
This means that a timeout failure takes a lot longer to happen and there's
really no need for a full 10s timeout.  Also, when testing that messages are
sent in the right order, there's no need to send 10 messages, so cut a few of
them.  Since there's a built-in 2s delay between each sent message, that means
the test was always taking *at least* 20s to execute.
---
 tests/twisted/channels/join-muc-channel.py   |    2 +-
 tests/twisted/connect/connect-success-ssl.py |    2 +-
 tests/twisted/connect/connect-success.py     |    2 +-
 tests/twisted/messages/leading-space.py      |    2 +-
 tests/twisted/messages/message-order.py      |   12 +-----------
 5 files changed, 5 insertions(+), 15 deletions(-)

diff --git a/tests/twisted/channels/join-muc-channel.py b/tests/twisted/channels/join-muc-channel.py
index 126b59c..7e2e73b 100644
--- a/tests/twisted/channels/join-muc-channel.py
+++ b/tests/twisted/channels/join-muc-channel.py
@@ -36,5 +36,5 @@ def test(q, bus, conn, stream):
     return True
 
 if __name__ == '__main__':
-    exec_test(test, timeout=10)
+    exec_test(test)
 
diff --git a/tests/twisted/connect/connect-success-ssl.py b/tests/twisted/connect/connect-success-ssl.py
index 3cf04e8..627eeb8 100644
--- a/tests/twisted/connect/connect-success-ssl.py
+++ b/tests/twisted/connect/connect-success-ssl.py
@@ -23,5 +23,5 @@ def test(q, bus, conn, stream):
     return True
 
 if __name__ == '__main__':
-    exec_test(test, {'use-ssl':dbus.Boolean(True)}, protocol=SSLIRCServer, timeout=10)
+    exec_test(test, {'use-ssl':dbus.Boolean(True)}, protocol=SSLIRCServer)
 
diff --git a/tests/twisted/connect/connect-success.py b/tests/twisted/connect/connect-success.py
index 9ef189b..3281764 100644
--- a/tests/twisted/connect/connect-success.py
+++ b/tests/twisted/connect/connect-success.py
@@ -22,5 +22,5 @@ def test(q, bus, conn, stream):
     return True
 
 if __name__ == '__main__':
-    exec_test(test, timeout=10)
+    exec_test(test)
 
diff --git a/tests/twisted/messages/leading-space.py b/tests/twisted/messages/leading-space.py
index a621993..ce24c76 100644
--- a/tests/twisted/messages/leading-space.py
+++ b/tests/twisted/messages/leading-space.py
@@ -51,5 +51,5 @@ def test(q, bus, conn, stream):
     return True
 
 if __name__ == '__main__':
-    exec_test(test, timeout=10, protocol=LeadingSpaceIRCServer)
+    exec_test(test, protocol=LeadingSpaceIRCServer)
 
diff --git a/tests/twisted/messages/message-order.py b/tests/twisted/messages/message-order.py
index 68dfd11..b2259ca 100644
--- a/tests/twisted/messages/message-order.py
+++ b/tests/twisted/messages/message-order.py
@@ -28,26 +28,16 @@ def test(q, bus, conn, stream):
     call_async(q, text_chan, 'Send', 0, '2')
     call_async(q, text_chan, 'Send', 0, '3')
     call_async(q, text_chan, 'Send', 0, '4')
-    call_async(q, text_chan, 'Send', 0, '5')
-    call_async(q, text_chan, 'Send', 0, '6')
-    call_async(q, text_chan, 'Send', 0, '7')
-    call_async(q, text_chan, 'Send', 0, '8')
-    call_async(q, text_chan, 'Send', 0, '9')
 
     q.expect('irc-privmsg', data={'message':'0','recipient':CHANNEL_NAME})
     q.expect('irc-privmsg', data={'message':'1','recipient':CHANNEL_NAME})
     q.expect('irc-privmsg', data={'message':'2','recipient':CHANNEL_NAME})
     q.expect('irc-privmsg', data={'message':'3','recipient':CHANNEL_NAME})
     q.expect('irc-privmsg', data={'message':'4','recipient':CHANNEL_NAME})
-    q.expect('irc-privmsg', data={'message':'5','recipient':CHANNEL_NAME})
-    q.expect('irc-privmsg', data={'message':'6','recipient':CHANNEL_NAME})
-    q.expect('irc-privmsg', data={'message':'7','recipient':CHANNEL_NAME})
-    q.expect('irc-privmsg', data={'message':'8','recipient':CHANNEL_NAME})
-    q.expect('irc-privmsg', data={'message':'9','recipient':CHANNEL_NAME})
 
     call_async(q, conn, 'Disconnect')
     return True
 
 if __name__ == '__main__':
-    exec_test(test, timeout=10)
+    exec_test(test)
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list