testsuite/test_event.py: fix race condition because of state thread
authorThomas Vander Stichele <thomas@apestaart.org>
Wed, 26 Oct 2005 14:53:28 +0000 (14:53 +0000)
committerThomas Vander Stichele <thomas@apestaart.org>
Wed, 26 Oct 2005 14:53:28 +0000 (14:53 +0000)
Original commit message from CVS:
* testsuite/test_event.py:
fix race condition because of state thread

ChangeLog
testsuite/test_event.py

index 356e237..9d289d6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2005-10-26  Thomas Vander Stichele  <thomas at apestaart dot org>
 
+       * testsuite/test_event.py:
+         fix race condition because of state thread
+
+2005-10-26  Thomas Vander Stichele  <thomas at apestaart dot org>
+
        * testsuite/test_bin.py:
          fix race condition because of state thread
 
index ca8a73d..3341857 100644 (file)
@@ -22,6 +22,8 @@
 
 import os
 import sys
+import time
+
 from common import gst, unittest, testhelper, TestCase
 
 class EventTest(TestCase):
@@ -35,6 +37,11 @@ class EventTest(TestCase):
         gst.debug('setting pipeline to NULL')
         self.pipeline.set_state(gst.STATE_NULL)
         gst.debug('set pipeline to NULL')
+        # FIXME: wait for state change thread to die
+        while self.pipeline.__gstrefcount__ > 1:
+            gst.debug('waiting for self.pipeline G rc to drop to 1')
+            time.sleep(0.1)
+        self.assertEquals(self.pipeline.__gstrefcount__, 1)
 
         del self.sink
         del self.pipeline