[Pkg-telepathy-commits] [telepathy-mission-control-6] 32/280: servicetest: if expect() fails, log what was expected

Simon McVittie smcv at debian.org
Thu Mar 27 20:07:02 UTC 2014


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch debian
in repository telepathy-mission-control-6.

commit b128395b7cf73cd3134d216dfb1c7eca05830fce
Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Mon Sep 30 13:07:25 2013 +0100

    servicetest: if expect() fails, log what was expected
    
    It's usually possible to derive it from the backtrace, but logging
    the pattern (as expect_many() does) makes it quicker.
    
    Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69885
    Reviewed-by: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>
---
 tests/twisted/servicetest.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tests/twisted/servicetest.py b/tests/twisted/servicetest.py
index c464d8f..821240b 100644
--- a/tests/twisted/servicetest.py
+++ b/tests/twisted/servicetest.py
@@ -197,7 +197,14 @@ class BaseEventQueue:
         t = time.time()
 
         while True:
-            event = self.wait([pattern.subqueue])
+            try:
+                event = self.wait([pattern.subqueue])
+            except TimeoutError:
+                self.log('timeout')
+                self.log('still expecting:')
+                self.log(' - %r' % pattern)
+                raise
+
             self._check_forbidden(event)
 
             if pattern.match(event):

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-telepathy/telepathy-mission-control-6.git



More information about the Pkg-telepathy-commits mailing list