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
This commit is contained in:
Thomas Vander Stichele 2005-10-26 14:29:58 +00:00
parent 015db96c26
commit c40dff2539
2 changed files with 12 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2005-10-26 Thomas Vander Stichele <thomas at apestaart dot org>
* testsuite/test_bin.py:
fix race condition because of state thread
2005-10-24 Thomas Vander Stichele <thomas at apestaart dot org>
* configure.ac:

View file

@ -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)