summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2014-03-26 08:43:25 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2014-03-27 09:20:49 +0000
commit43e2a1bacc556dc66524e79fdc42f96cfdc37e3d (patch)
tree6d92e354994e47b26deca6f8c2e615ec29bdb514
parentaa70226ed9ba21cdfacad6484156935061bbf771 (diff)
account-manager/server-drops-us.py: update so it actually passes
The backoff algorithm changed in 5.4.2 and 5.5.3, and the test framework now requires events to contain at least one "-"; but this test isn't run by default, so we never found out that it would fail. It's still disabled by default, because it takes about 30 seconds.
-rw-r--r--tests/twisted/account-manager/server-drops-us.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/twisted/account-manager/server-drops-us.py b/tests/twisted/account-manager/server-drops-us.py
index 0176b957..8a335f47 100644
--- a/tests/twisted/account-manager/server-drops-us.py
+++ b/tests/twisted/account-manager/server-drops-us.py
@@ -77,8 +77,9 @@ def test(q, bus, mc):
# Connect succeeds
conn.StatusChanged(cs.CONN_STATUS_CONNECTED, cs.CSR_NONE_SPECIFIED)
+ # With current MC constants this happens after 3 seconds
conn = drop_and_expect_reconnect(q, bus, conn)
- conn = drop_and_expect_reconnect(q, bus, conn)
+ # With current MC constants this happens after a further 9 seconds
conn = drop_and_expect_reconnect(q, bus, conn)
forbidden = [EventPattern('dbus-method-call', method='RequestConnection')]
@@ -91,8 +92,10 @@ def test(q, bus, mc):
# This test can be considered to have succeeded if we don't
# RequestConnection again before the test fails due to timeout.
+ # With current MC constants the next attempt is after 27 seconds,
+ # which is more than the 15 second timeout hard-coded below.
try:
- q.expect('the end of the world')
+ q.expect('the-end-of-the-world')
except TimeoutError:
return
else:
@@ -128,4 +131,6 @@ def drop_and_expect_reconnect(q, bus, conn):
return conn
if __name__ == '__main__':
- exec_test(test, {})
+ # A 15 second timeout is enough to retry after 3 seconds, then 9 seconds,
+ # but not 27 seconds.
+ exec_test(test, {}, timeout=15)