From c40dff253986c46e4641e0fcdfc055ed5d4d4a00 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Wed, 26 Oct 2005 14:29:58 +0000 Subject: [PATCH] testsuite/test_bin.py: fix race condition because of state thread Original commit message from CVS: * testsuite/test_bin.py: fix race condition because of state thread --- ChangeLog | 5 +++++ testsuite/test_bin.py | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e84dc60..356e237 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-10-26 Thomas Vander Stichele + + * testsuite/test_bin.py: + fix race condition because of state thread + 2005-10-24 Thomas Vander Stichele * configure.ac: diff --git a/testsuite/test_bin.py b/testsuite/test_bin.py index 16437ed..1857790 100644 --- a/testsuite/test_bin.py +++ b/testsuite/test_bin.py @@ -21,9 +21,11 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -import sys from common import gobject, gst, unittest, TestCase +import sys +import time + # see # http://www.sicem.biz/personal/lgs/docs/gobject-python/gobject-tutorial.html class MyBin(gst.Bin): @@ -136,6 +138,10 @@ class Preroll(TestCase): self.bin = gst.Bin('bin') def tearDown(self): + # FIXME: wait for state change thread to settle down + while self.bin.__gstrefcount__ > 1: + time.sleep(0.1) + self.assertEquals(self.bin.__gstrefcount__, 1) del self.bin TestCase.tearDown(self) -- 2.7.4